public acadapp as object
Private Sub Form_Load()
On Error Resume Next
Set acadapp = GetObject(, "AutoCAD.Application")
If Err Then
Err.Clear
Set acadapp = CreateObject("AutoCAD.Application")
If Err Then
MsgBox ("不能运行AutoCAD R14,请检查。")
Exit Sub
End If
End If
acadapp.Visible = True
End Sub