Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to reference cells dynamically ArthurN Excel Discussion (Misc queries) 2 February 23rd 06 10:08 AM
Dynamically add a Reference to an Add-In in VBA (Excel 2000?) Richard[_34_] Excel Programming 2 February 5th 06 08:03 AM
Can I Reference a Cell €śNumber€ť Dynamically? CRayF Excel Programming 3 September 19th 05 08:42 AM
How to dynamically add a reference to personal.xls ? John Mitchell[_2_] Excel Programming 2 April 11th 05 12:08 PM
Changing Reference Dynamically Shashi Bhosale Excel Programming 1 September 9th 03 03:36 PM


All times are GMT +1. The time now is 11:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"