LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Adding library references programmatically


Hi Allen,

i have a proposal how you can dynamically add library references.
You open an empty EXCEL-file with an OLE-Connection, add a new modul
and import a small macro which looks like this:
Sub Set_Reference
Dim c As Object
Set c = Application.VBE.ActiveVBProject.References.AddFrom Guid(..)
End Sub

You save this EXCEL file, open the file again and start the macro wit
the appropriate method like (the coding depends on the language whic
which you build up the OLE-connection)

call method of H_WORKS 'SaveAs' Exporting #1 = filename
CALL METHOD OF H_WORKS 'Close'
CALL METHOD OF H_WORKS 'Open' = H_WORK EXPORTING
#1 = filename
CALL METHOD OF EXCEL1 'Run' EXPORTING #1 =
'Set_Reference'.

After this the new reference is set and you can add the macros whic
you want to execute the same way as described above. After this sav
the file, reopen it and start the macro you want.

I don't know if this is what you want, but i desperatly looking fo
this during the last weeks and was happy when i finally found it by m
own.

Take care
Guente

--
Guenter-Jose
-----------------------------------------------------------------------
Guenter-Josef's Profile: http://www.excelforum.com/member.php...fo&userid=2633
View this thread: http://www.excelforum.com/showthread.php?threadid=27370

 
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
How can I programmatically change Link references? Boulder_dude Links and Linking in Excel 5 June 20th 08 09:44 PM
programmatically Set Reference to Library Todd uttenstine Excel Programming 6 April 30th 04 10:55 AM
Library references Amanda[_5_] Excel Programming 1 January 6th 04 06:40 PM
Object Library References Nelson[_5_] Excel Programming 5 December 10th 03 08:54 PM
Object Library References Nelson[_6_] Excel Programming 1 December 10th 03 03:31 AM


All times are GMT +1. The time now is 11:08 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"