Message 1 of 4
VBA references by coding

Not applicable
04-12-2001
07:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I grabbed this from an earlier message and am having a problem getting
it to work. AutoCAD 14.01, *Misrosoft Visual Basic Extensibility....*
reference is set. I get the *Object variable or With block variable
not set* error, err.number #91. The code has been slightly modified,
and the original code gave the same error.
Thanks,
Monte
Sub AddReference()
Dim objIDE As VBIDE.VBE
Dim FileName As String
FileName = "c:\winnt\system32\my.dll"
On Error GoTo AddReference_Error
Set objIDE = Application.VBE
objIDE.ActiveVBProject.References.AddFromFile FileName
Exit Sub
AddReference_Error:
MsgBox Err.Description & " " & Err.Number, vbCritical, "Cannot Add
Reference "
End Sub
it to work. AutoCAD 14.01, *Misrosoft Visual Basic Extensibility....*
reference is set. I get the *Object variable or With block variable
not set* error, err.number #91. The code has been slightly modified,
and the original code gave the same error.
Thanks,
Monte
Sub AddReference()
Dim objIDE As VBIDE.VBE
Dim FileName As String
FileName = "c:\winnt\system32\my.dll"
On Error GoTo AddReference_Error
Set objIDE = Application.VBE
objIDE.ActiveVBProject.References.AddFromFile FileName
Exit Sub
AddReference_Error:
MsgBox Err.Description & " " & Err.Number, vbCritical, "Cannot Add
Reference "
End Sub