我试了半天,
Private Sub Command1_Click() Dim acadapp As AutoCAD.AcadApplication Call 连接AutoCAD End Sub Public Sub 连接AutoCAD() On Error Resume Next Set acadapp = GetObject(, "AutoCAD.AcadApplication") If Err.Number Then Err.Clear Set acadapp = CreateObject("AutoCAD.AcadApplication") MsgBox (Err.Description) End If End Sub
它总提示ActiveX对象无法创建
这是怎么回事呢?
Dim acadapp As AcadApplication Private Sub Command1_Click() Call 连接AutoCAD End Sub Public Sub 连接AutoCAD() On Error Resume Next Set acadapp = GetObject(, "AutoCAD.AcadApplication") If Err.Number Then Err.Clear Set acadapp = CreateObject("AutoCAD.AcadApplication") MsgBox (Err.Description) End If End Sub
错误提示
ActiveX 部件不能创建对象