Message 1 of 3
having problem with getinterfaceobject

Not applicable
09-24-2004
10:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
The following function always fails at the last line.
GetobjProj = objProj
The error msg says:
object variable or with block variable not set.
Can someone help? Thanks a lot.
Public Function GetobjProj(ProjID As String) As Object
Dim ProjID2 As String
ProjID2 = ProjID & "." & Left(ThisDrawing.GetVariable("ACADVER"), 2)
Dim objProj As Object
With ThisDrawing.Application
Set objProj = .GetInterfaceObject(ProjID2)
If objProj Is Nothing Then
Set objProj = .GetInterfaceObject(ProjID)
End If
End With
GetobjProj = objProj
End Function
GetobjProj = objProj
The error msg says:
object variable or with block variable not set.
Can someone help? Thanks a lot.
Public Function GetobjProj(ProjID As String) As Object
Dim ProjID2 As String
ProjID2 = ProjID & "." & Left(ThisDrawing.GetVariable("ACADVER"), 2)
Dim objProj As Object
With ThisDrawing.Application
Set objProj = .GetInterfaceObject(ProjID2)
If objProj Is Nothing Then
Set objProj = .GetInterfaceObject(ProjID)
End If
End With
GetobjProj = objProj
End Function