Word VBA referencing Excel, Works on one computer but not another

devanrose33

New Member
Joined
Dec 8, 2015
Messages
6
Hi,

I've created a Microsoft Word (2010) VBA code that references an Excel workbook. You would have the Excel workbook open prior to running the Word macro. Basically, the Word document deletes certain paragraphs based on information in the excel document. I have this macro running perfectly on my computer. I've sent it to my team today for testing and a team member was receiving the "subscript out of range" message.

When I ran the debugger on his Microsoft Word it was highlighting where I named the Microsoft Excel Workbook...

Dim Excel As Object
Dim Tool As Object


Set Excel = GetObject(, "Excel.Application")
If Err Then
bstartApp = True
Set Excel = CreateObject("Excel.Application")
End If


With Excel
Set Tool = .Workbooks("VB_Combined_Quoting_Tool_DUMMY")

Any ideas as to why the macro would work fine on my computer but not on another?

Thanks!



 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,214,642
Messages
6,120,700
Members
448,979
Latest member
DET4492

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top