Excel - how to prevent new office version from upgrading word object reference

Z

Zoner

Hi all...

I have an excel spreadsheet, with Macro's which control Microsoft Word.
They were written using Excel and Word from Office 2000 (Word 9.0).

This is a shared spreadsheet, so some other users have Office XP. After
they open the spreadsheet and make changes, the referece to the
Microsoft Word Objects in the VBA editor is upgraded to V11.

When the spreadsheet is then opened in Excel 2000, errors messages
popup. I then have to remove the "Missing Word 11.0" reference and
re-check the Word9.0 reference.

Is there a way to prevent this from happening?

Thanks in advance. Matt.
 
P

Piotr Lipski

Hi all...

I have an excel spreadsheet, with Macro's which control Microsoft Word.
They were written using Excel and Word from Office 2000 (Word 9.0).

[...]

Remove any Word reference from VBA project and use late binding.
 
G

Guest

Remove the references and use this code to create your word application
object...

dim appWord as object

set appWord = createobject('Word.Application")
 
Z

Zoner

Remove the references and use this code to create your word application
object...

dim appWord as object

set appWord = createobject('Word.Application")

Thanks!

I have this working for Word.Application but can not seem to use the
same method to replace:
Dim wRng As Word.Range
With:
Dim wRng As Object
Set wRng = CreateObject("Word.Range")

- I get an error on the Set wRng saying it can not create the object.

Should this work? I am also using Word.Table, so suspect I will get the
same error there.

Thanks again.

Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top