View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Stuart[_5_] Stuart[_5_] is offline
external usenet poster
 
Posts: 413
Default Addin / Library Reference question

Many Thanks,

Regards.

"Chip Pearson" wrote in message
...
Stuart,

The following will add a reference to the Extensibility 5.3
library.


ThisWorkbook.VBProject.References.AddFromGuid _
GUID:="{0002E157-0000-0000-C000-000000000046}", _
Major:=5, Minor:=3



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Stuart" wrote in message
...
Many thanks.
Can you explain further for me please?

Say addin is developed under Excel2000 and being geared
for an Excel2000 or 2003 user.

Say the addin has code requiring a Reference to be set to
Microsoft Visual Basic for Applications Extensibility 5.3
(as in Excel2000).

Can you show me how to obtain the information I need
for the code (assuming I can access an Excel2003 machine)
please?

Regards and thanks.


"Chip Pearson" wrote in message
...
Stuart,

You would have to know the exact file name or the GUID of
library
you wish to reference. If you do, then you can use code like

ThisWorkbook.VBProject.References.AddFromFile "full file name"
' or
ThisWorkbook.VBProject.References.AddFromGuid "guid", Major,
Minor


This should be in the Auto_Open procedure of the add-in, in a
module that does not use any objects defined in the library to
which you are adding the reference.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Stuart" wrote in message
...
Say an addin requires one or more References to be set.
When distributing the addin to a new user, can those
References be set programmatically within the addin's
code, please?

Regards


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.766 / Virus Database: 513 - Release Date:
17/09/2004






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.766 / Virus Database: 513 - Release Date:
17/09/2004






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.766 / Virus Database: 513 - Release Date: 17/09/2004