LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default programmatically Set Reference to Library

To add the reference to the this

Sub RefExtensibityLib()
'// For Excel 2002+
'// You need to change your Security settings
'// to accept changes to the VBA

'\'if it already exits
On Error Resume Next
ThisWorkbook.VBProject.References.AddFromGuid _
"{0002E157-0000-0000-C000-000000000046}", 5, 0

End Sub

for an explaination see here

http://www.mrexcel.com/board2/viewtopic.php?t=8251

"Todd Huttenstine" wrote in message ...
Sub Upgrade()
Dim VBComp As VBIDE.VBComponent
Dim Sfx As String

p = "Q:\CS Management Reports\Reports
Setup\Administrator Files"
f = "Administrator Setup.xls"
s = "Reports Setup"
a = "F6"

'MsgBox GetValue(p, f, s, a)
If GetValue(p, f, s, a) = 1 Then
'Code below if code does NOT equal 1
If MsgBox("An upgrade is available. Would you like to
upgrade now?", vbYesNo) = vbNo Then
With CreateObject("Wscript.Shell")
.Popup ("Program Setup Up-To-Date. Now quitting
application...") _
, 1, "Ops Reports Setup", 64
End With
Exit Sub
Else
'Code below if code DOES equal 1

'EXPORTING ALL MODULES IN A WORKBOOK
For Each VBComp In Workbooks
("ImportData.xls").VBProject.VBComponents
Select Case VBComp.Type
Case vbext_ct_ClassModule, vbext_ct_Document
Sfx = ".cls"
Case vbext_ct_MSForm
Sfx = ".frm"
Case vbext_ct_StdModule
Sfx = ".bas"
Case Else
Sfx = ""
End Select
If Sfx < "" Then
VBComp.Export _
Filename:="Q:\CS Management Reports\Reports
Setup\Administrator Files\Exported Modules" & "\" &
VBComp.Name & ".txt"
'Filename:="Q:\CS Management Reports\Reports
Setup\Administrator Files\Exported Modules" & "\" &
VBComp.Name & Sfx
'Filename:=ActiveWorkbook.path & "\" &
VBComp.Name & Sfx
End If
Next VBComp

'Shows Program Update message box
With CreateObject("Wscript.Shell")
.Popup ("Program Update. Now quitting
application...") _
, 1, "Ops Reports Setup", 64
End With
End If
End If
End Sub



-----Original Message-----
Show us the code and we'll have a go.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Todd Huttenstine"

wrote in message
...
How would I do that?



-----Original Message-----
Todd,

Never tried it myself, but check out this tip from RB

Smissaert
http://tinyurl.com/2zuqp

By the way, why can't you use late binding?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the

Purbecks
(remove nothere from the email address if mailing

direct)

"Todd uttenstine"

wrote in message
...
I need to programmatically set reference to Microsoft
Visual Basic for Applications Extensibility 5.3

Library.
How do I set a reference to this library through

code?



Thank you

Todd Huttenstine


.



.

 
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
Library Reference files Cindy Excel Programming 4 April 2nd 04 04:42 PM
Setting up Reference Library using VBA Alan Excel Programming 1 November 5th 03 03:18 AM
Programmatically Add Reference` keepitcool Excel Programming 1 September 16th 03 05:30 PM
Programmatically Add Reference` Jean-Paul Viel Excel Programming 0 September 16th 03 02:23 PM
Can i set a reference programmatically? Tom Ogilvy Excel Programming 1 August 19th 03 04:24 PM


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