ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   File constantly defaulting to previous version of Word Object Libary (https://www.excelbanter.com/excel-programming/392793-file-constantly-defaulting-previous-version-word-object-libary.html)

bony_tony

File constantly defaulting to previous version of Word Object Libary
 
Hi,
I referenced the Word Object Libary on my machine for some Word VBA
code I was using in some files.

When other people in my department use the files, they have a previous
version (10.0) of word, so the one I was using (11.0) is obviously
missing. I can fix it by selecting version 10.0 from their machine,
no problem.

The problem is that I have to re-reference the previous version of
Word on their machine every time they open one of the files. I'm
thinking it may have something to do with the fact I have a script on
my machine which opens the files overnight, and updates and saves
them.

Is there any way I can avoid having to reference the Object Libarys
each time? (without installing the new version of Word).

Cheers
Tony


Jim Cone

File constantly defaulting to previous version of Word Object Libary
 

You should write your code on a machine using the oldest version
of Word that is in use. The references will then automatically adjust
when used on other machines.

-or-

Use "late binding"...
Dim objWord as Object
Set objWord = CreateObject ("Word.Application")
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware




"bony_tony"
wrote in message
Hi,
I referenced the Word Object Libary on my machine for some Word VBA
code I was using in some files.

When other people in my department use the files, they have a previous
version (10.0) of word, so the one I was using (11.0) is obviously
missing. I can fix it by selecting version 10.0 from their machine,
no problem.

The problem is that I have to re-reference the previous version of
Word on their machine every time they open one of the files. I'm
thinking it may have something to do with the fact I have a script on
my machine which opens the files overnight, and updates and saves
them.

Is there any way I can avoid having to reference the Object Libarys
each time? (without installing the new version of Word).

Cheers
Tony



All times are GMT +1. The time now is 04:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com