Unable to get AutoCAD object using 'GetObject' method using VB6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
We have a few legacy VB6 projects, in which we try to get the AutoCAD object from the below sample code:
On Error Resume Next
Public AcadApp As Object
Set objApp = GetObject(, "AutoCAD.Application")
If Err Then
Err.Clear
Set objApp = GetObject(, "AutoCAD.Application.20")
End If
If Err Then
Err.Clear
Set objApp = GetObject(, "AutoCAD.Application.21")
End If
This code was working perfect, right from AutoCAD 2005 till AutoCAD 2017, when the code was finally compiled in Win 7.
Now when we compiled the same source, the 'GetObject' method fails to create an instance of the AutoCAD object.
The error code is 429 "ActiveX component can't create object".
We are using x64 version AutoCAD 2015, 2016 and 2017 and the OS is Windows 10.
Whereas the 'CreateObject' method creates the AutoCAD objects perfectly.
Set AcadApp = CreateObject("AutoCAD.Application.20")
It would be helpful if you could resolve this ASAP.
regards,
CADSINDIAADN