Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to dynamically add/change Reference?
Hello -
I have some code in Excel where I open up a Word Document ... Set lFileObject = CreateObject("Scripting.FileSystemObject") Dim lWordApplication As Word.Application Dim lWordDocument As Word.Document .... I have the Microsoft Word 11.0 Object Library added under Tools References to make this work. The problem is that at my company there are still some machines with Word 10.0. Right now I need two different versions of the Excel file, once with the reference to 11.0 and one with the reference to 10.0. Is there a way I can automatically add the reference based on which version of Word is installed? Thanks! Joe |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to dynamically add/change Reference?
You don't need to make the explicit reference. Try something more like this...
Sub test() Dim wrdApp As Object Set wrdApp = CreateObject("Word.Application") wrdApp.Visible = True End Sub -- HTH... Jim Thomlinson "Joe HM" wrote: Hello - I have some code in Excel where I open up a Word Document ... Set lFileObject = CreateObject("Scripting.FileSystemObject") Dim lWordApplication As Word.Application Dim lWordDocument As Word.Document .... I have the Microsoft Word 11.0 Object Library added under Tools References to make this work. The problem is that at my company there are still some machines with Word 10.0. Right now I need two different versions of the Excel file, once with the reference to 11.0 and one with the reference to 10.0. Is there a way I can automatically add the reference based on which version of Word is installed? Thanks! Joe |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to reference cells dynamically | Excel Discussion (Misc queries) | |||
Dynamically add a Reference to an Add-In in VBA (Excel 2000?) | Excel Programming | |||
Can I Reference a Cell €śNumber€ť Dynamically? | Excel Programming | |||
How to dynamically add a reference to personal.xls ? | Excel Programming | |||
Changing Reference Dynamically | Excel Programming |