dim acadapp As Object
dim Thisdrawing As Object
Set acadapp = GetObject(, "AutoCAD.Application")
If Err Then
Err.Clear
Set acadapp = CreateObject("AutoCAD.Application")
If Err Then
MsgBox Err.Description
End
Exit Sub
End If
End If
acadapp.Visible = True
Set Thisdrawing = acadapp.ActiveDocument