Article ID: 184579
Article Last Modified on 9/12/2006
Sub Create_Reference()
Application.VBE.ActiveVBProject.References.AddFromFile _
"<hard disk>:Microsoft Office 98:Book2"
Use_Book2_Reference
End Sub
Sub Use_Book2_Reference()
'Make calls to Book2 objects here.
End Sub
NOTE: You cannot make reference calls to objects that have been added
to the object library programmatically in the same procedure. You must
run another procedure to make the calls.
183132 XL98 Err Msg: "Name Conflicts with Existing Module"
Sub Remove_Reference()
Dim x As Object
Set x = Application.VBE.ActiveVBProject _
.References.Item("Project2")
Application.VBE.ActiveVBProject.References.Remove x
End Sub
163435 VBA: Programming Resources for Visual Basic for Applications
Additional query words: references XL98
Keywords: kbhowto kbprogramming kbdtacode KB184579