#1   Report Post  
Posted to microsoft.public.excel.programming
Tom Tom is offline
external usenet poster
 
Posts: 25
Default Reference.

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Reference.


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 :

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Reference.

"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

"keepITcool" skrev i melding
ft.com...

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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Reference.

Hi Tom

You are best off using "late binding" for this. Which usually means that you
replace all known hardcoded object types with simply "Object" and let
Windows and the registry do the detective work. See
http://erlandsendata.no/english/inde...baoleolebasics

HTH. Best wishes Harald

"Tom" skrev i melding
...
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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nesting a sheet name reference within a cell reference??? Broyston Excel Discussion (Misc queries) 9 July 8th 08 08:35 PM
Changing sheet reference to cell reference TeeJay Excel Worksheet Functions 3 October 19th 07 11:50 AM
Using an offset formula for the reference in a relative reference Cuda Excel Worksheet Functions 6 November 15th 06 05:12 PM
Row reference increment but preserve column reference Pwanda Excel Worksheet Functions 1 April 28th 05 01:12 PM
Macro to Reference Column Next to Current Reference dolphinv4 Excel Discussion (Misc queries) 2 April 11th 05 08:36 AM


All times are GMT +1. The time now is 03:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"