Home > Software engineering >  Could you tell me why the vb call CAD times wrong activex components can't create the object
Could you tell me why the vb call CAD times wrong activex components can't create the object

Time:11-08

I want to use vb to design programs to open the CAD first, and then open SCR script file for automatic drawing in CAD, the code is always check that the CAD is on the local error activex components can't create objects is why?
The
reference
Private Sub Command1_Click ()
Dim acadApp As AcadApplication
'On the Error Resume Next
The Set acadApp=GetObject (, "AutoCAD. Application") 'check that the CAD is on
If Err Then
Err. Clear
The Set acadApp=CreateObject (" AutoCAD. Application ") 'open CAD
If Err Then
MsgBox Err. Number & amp; ":" & amp; Err. Open the Description 'failure
The Exit Sub
End the If
End the If

AcadApp. Visible=True


End Sub
  • Related