Reference.

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

Hello,

how can I by macro add and remove thit refernces:

Microsoft Word X.0 Object Library
C:\Program Files\Microsoft Office\OfficeX\MSWORD.OLB

x - menas 10 or 11, thats the problem I need this reference switch by
version of Office

I hope somebady help me.

Thanks tom
 
IMO there is NO need to switch references, just make sure
that you get no compile errors in either version.
(very likely the oldest)

OR use latebound code....


if you still want to change /add references you MUST be sure
that users have "Allow access to visual basic project"
enabled...
(and from Office 2003 you can only change this via the registry)


then you can access refs via
Application.VBE.ActiveVBproject.References
It may be a good idea to add a reference to VB Extensibility.

But as I said there is NO need.



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Tom wrote :
 
"NO need" isn't always generally true -but I haven't tested this on Office
libraries.
I have excel files that are used by multiple users, and it has reference to
ADO. I wrote and compiled it using ADO 2.1. One of our users had an upgrade
to ADO 2.5. The file upgraded the reference, remembered it on Save and
expected 2.5 next time it ran. After that it refused to run on a 2.1 machine
even without 2.5 spesific objects or commands in the code.

They don't call it "dll hell" for nothing, there is at least a potential
problem somewhere :-)

Best wishes Harald
 

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