ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Does library reference stay with the code? (https://www.excelbanter.com/excel-programming/363568-does-library-reference-stay-code.html)

Peter Cornish

Does library reference stay with the code?
 

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

--
Peter Cornis
-----------------------------------------------------------------------
Peter Cornish's Profile: http://www.excelforum.com/member.php...fo&userid=3518
View this thread: http://www.excelforum.com/showthread.php?threadid=54949


Ardus Petus

Does library reference stay with the code?
 
Yes, references are stored within the workbook.

HTH
--
AP

"Peter Cornish"
a écrit dans le message de news:
...

In order to manipulate Word files from Excel the Word object library
must be enabled using the Tools menu in the VB Editor. After doing
this my code works correctly. But will the Excel file still operate
correctly on another machine - will the Word object library have to be
manually enabled on every machine that uses the file?


--
Peter Cornish
------------------------------------------------------------------------
Peter Cornish's Profile:
http://www.excelforum.com/member.php...o&userid=35183
View this thread: http://www.excelforum.com/showthread...hreadid=549490




Jim Thomlinson

Does library reference stay with the code?
 
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...
--
HTH...

Jim Thomlinson


"Peter Cornish" wrote:


In order to manipulate Word files from Excel the Word object library
must be enabled using the Tools menu in the VB Editor. After doing
this my code works correctly. But will the Excel file still operate
correctly on another machine - will the Word object library have to be
manually enabled on every machine that uses the file?


--
Peter Cornish
------------------------------------------------------------------------
Peter Cornish's Profile: http://www.excelforum.com/member.php...o&userid=35183
View this thread: http://www.excelforum.com/showthread...hreadid=549490




All times are GMT +1. The time now is 01:09 AM.

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