Message 1 of 5
GetObject / CreateObject

Not applicable
12-20-2000
01:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a VB6 program. At the start of the program I check
to see if a session of AutoCAD is running.
Set myApp = GetObject(, "AutoCAD.Application")
The problem is that although AutoCAD is running, Err
is true and my program opens a new session of AutoCAD
If Err Then
Err.Clear
Set myApp = CreateObject("AutoCAD.Application")
I have AUTOCAD 14 running on Win NT.
Public Sub Main()
On Error Resume Next
Set myApp = GetObject(, "AutoCAD.Application")
If Err Then
Err.Clear
Set myApp = CreateObject("AutoCAD.Application")
If Err Then
MsgBox Err.Description
Exit Sub
End If
End If
Set myDoc = myApp.ActiveDocument
End Sub
to see if a session of AutoCAD is running.
Set myApp = GetObject(, "AutoCAD.Application")
The problem is that although AutoCAD is running, Err
is true and my program opens a new session of AutoCAD
If Err Then
Err.Clear
Set myApp = CreateObject("AutoCAD.Application")
I have AUTOCAD 14 running on Win NT.
Public Sub Main()
On Error Resume Next
Set myApp = GetObject(, "AutoCAD.Application")
If Err Then
Err.Clear
Set myApp = CreateObject("AutoCAD.Application")
If Err Then
MsgBox Err.Description
Exit Sub
End If
End If
Set myDoc = myApp.ActiveDocument
End Sub