Article ID: 160647
Article Last Modified on 11/23/2006
Sub Create_Reference()
Application.VBE.ActiveVBProject.References.AddFromFile _
"C:\My Documents\Book2.xls"
Use_Book2_Reference
End Sub
Sub Use_Book2_Reference()
'Make calls to Book2.xls 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.
156882 XL97 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: 97 XL97 tools references vba
Keywords: kbhowto kbprogramming KB160647