 - Dim myApp as AcadApplication
- Dim myDoc as AcadDocument
- 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
|