Private Sub cmddo_click()
Size = 0
On Error Resume Next
Set acadapp = GetObject(, "AutoCAD.application")
If Err Then
Err.Clear
Set acadapp = CreateObject("AutoCAD.application")
If Err Then
MsgBox Err.Description
Exit Sub
End If
End If
Set acaddoc = acadapp.activedocument