I am writing a VB program to extend the BOM from Dwgs to MS-Access. From the API help of M2004, I found this information:
Dim mcad As McadApplication
Set mcad = ThisDrawing.Application.GetInterfaceObject("Mcad.Application")
But I do not know how to change these code into Visual Basic 6 other than VBA. I wrote like this:
Dim acadApp As AcadApplication
Set acadApp = GetObject(, "AutoCAD.Application.16")
If Err Then
Err.Clear
Set acadApp = CreateObject("AutoCAD.Application.16")
If Err Then
MsgBox Err.Description
Exit Sub
End If
End If
When I run it on some other computers, sometimes it open AutoCAD2004 only but M2004, so I think McadApplication should be used here.
Could you tell me how to translate the VBA code into VB6?
Thank you very much!