Does library reference stay with the code?

  • Thread starter Thread starter Peter Cornish
  • Start date Start date
P

Peter Cornish

In order to manipulate Word files from Excel the Word object librar
must be enabled using the Tools menu in the VB Editor. After doin
this my code works correctly. But will the Excel file still operat
correctly on another machine - will the Word object library have to b
manually enabled on every machine that uses the file
 
There can be a bit of an issue with the Word library in that it is dependant
on the version of Word. If you reference a version of word that the target
system is not using then you will come back with a missing reference. You can
get around that by not referencing the Word library and doing something like
this...

dim wrdApp as object

set wrdApp = createobject("Word.Application")

The only thing to note here is that since you have not made a direct
reference to the Word library intellisense will not work as you are creating
the code. Since I like having the intellisence I usually add the reference
while I am developing the code and then remove the reference at the end and
add the above code...
 

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

Back
Top