Run-time Error 429. ActiveX component can't create object

Run-time Error 429. ActiveX component can't create object

sjmacad
Participant Participant
7,953 Views
7 Replies
Message 1 of 8

Run-time Error 429. ActiveX component can't create object

sjmacad
Participant
Participant

Hello,

 

I am using VB6 and AutoCAD 2017.  I recently changed to a new machine with Windows 10.  Many programs that I have written in the past now give Run-time error 429.  ActiveX component can't create object.

 

So I tried a following simple short program to test it out.  I got the same error.  Funny thing is when I compile this program, the AutoCAD starts without any error. 

Private Sub Command1_Click()
    Dim objAcadApp As AcadApplication
   'Set objAcadApp = New AcadApplication
    Set objAcadApp = CreateObject("AutoCAD.Application.21")
     objAcadApp.Visible = True
End Sub

 

In above program, I tried both lines New AcadApplication and CreateObject.

 

I also tried to open Excel and Word and they work fine.

 

I have searched the forum for this issue but could not find any helpful solution.

 

 

Any help will be appreciated.

0 Likes
7,954 Views
7 Replies
Replies (7)
Message 2 of 8

ambrosl
Autodesk
Autodesk

Does the error occur when you are only trying to debug a problem, since you say it seems to work fine when the program is compiled.  Are you using Windows 64-bit and AutoCAD 64-bit by any chance?



Lee Ambrosius
Senior Principal Content Experience Designer
For additional help, check out the AutoCAD Developer Documentation
0 Likes
Message 3 of 8

sjmacad
Participant
Participant

1.  Error occurs every time I am trying to debug the program.

2.  For compile program it is hit or miss.  Some programs it works, some program it does not.

3.  Yes, using Windows 10, 64 bit and AutoCAD 64 bit.

 

Thank you for looking into this.  Hopefully there is a solution.

0 Likes
Message 4 of 8

ambrosl
Autodesk
Autodesk

Was your previous machine running Windows 32-bit and AutoCAD 32-bit?  The programs that work, are they very basic and don't utilize many or no third-party libraries by chance?

 

You mention VB6 which runs external of AutoCAD, which shouldn't have the same problems as trying to run a 32-bit VBA project inside of AutoCAD 64-bit but that error message does feel similar to those that migrate from VBA 32-bit to VBA-64bit.

 

Are all the referenced libraries to the VB6 project available in your Windows 64-bit environment?  Not all 32-bit libraries have corresponding 64-bit versions so be sure the referenced libraries are installed.



Lee Ambrosius
Senior Principal Content Experience Designer
For additional help, check out the AutoCAD Developer Documentation
Message 5 of 8

sjmacad
Participant
Participant

The previous machine was 64 bit and so was the AutoCAD I think.

 

All libraries are available.

 

Note that the even the simple code to start the AutoCAD as posted in my original post that was started from scratch does not work.  

0 Likes
Message 6 of 8

ambrosl
Autodesk
Autodesk

If your previous version of Windows was 64-bit, then you most likely had AutoCAD 64-bit installed unless AutoCAD 2008 or earlier was installed.

 

Without seeing the development environment, it almost feels like the library is not registered properly.  You might want to check is to see if "AutoCAD.Application.21" is registered in the Windows Registry and that the file "acax21enu.tlb" is installed.

 

Note: Be careful about making changes in the Windows Registry, as changes could result in problems with software or even Windows no longer working properly.

 

Check to see if "AutoCAD.Application.21" is registered:

  1. Start the REGEDIT executable (Windows Start button > Run, enter REGEDIT and press Enter).
  2. In the Windows Registry Editor, click Edit > Find and search on the string AutoCAD.Application.21.
  3. If an instance is found it means it has been registered, but it is possible that the AutoCAD ActiveX API didn't get registered properly though.

Check to see if the "acax21enu.tlb" is installed:

  1. Open Windows Explorer.
  2. Browse to C:\Program Files\Common Files\Autodesk Shared.
  3. Check for the acax21enu.tlb file.

You could try to re-register the TLB file manually or reinstall AutoCAD 2017.



Lee Ambrosius
Senior Principal Content Experience Designer
For additional help, check out the AutoCAD Developer Documentation
0 Likes
Message 7 of 8

Anonymous
Not applicable
Fix by Cleaning Boot Go to the start menu Search for ‘msconfig.exe‘ in the search box and press Enter there Click on the User Account Control permission & click on the Continue option there On the General tab there, Click on the ‘Selective Startup‘ option there Under the Selective Startup tab, Click on ‘Clear the Load Startup‘ items check box Click on the services tab there, Click to select the “Hide All Microsoft Services” checkbox Then, click on the ‘Disable All‘ & press Ok button there After that, close the tab & restart your PC That’s it, done Still facing the same error try other methods here https://www.errorsolutions.tech/error/runtime-error-429/
0 Likes
Message 8 of 8

Anonymous
Not applicable

In my experience this is because Windows has changed things around from the VB6 days.  In the 'olden days', the HKLM hive used to house the registered AutoCAD.Application CLSID and CurVer keys.  These keys stored the last opened version of AutoCAD and would help outside applications know which version (if any) to launch.

 

At some point, they stopped using the HKLM hive and started using HKCU.  You can find both keys under the following:

<Hive>/Software/Classes/AutoCAD.Application

 

You'll find in both hives, the installed version of AutoCAD exists there too.  The only difference is that it will be appended with a number (e.g. AutoCAD.Application.20.1).  There keys with the numbers appended store the CLSID of that particular version.  The key without the number is the last used, or current default.

 

The issue is VB6 is old... so while the AutoCAD application knows to look into the HKCU hive, VB6 is still looking into HKLM.  Depending on the versions installed in your machine, and how long you've had it, you may not even have an AutoCAD.Application key (without the numbers) in the HKLM hive; if that's the case, you'll have to add it.

 

If  you have more than one version of AutoCAD installed, you'll be able to see each of the CLSID's under their respective keys (AutoCAD.Application.20, AutoCAD.Application.20.1, AutoCAD.Application.21, etc., etc.).

 

To fix the problem, make the key (AutoCAD.Application) in the HKLM hive mimic the key in the HKCU hive.  You'll need two folders under the key:

1) CLSID - The long string under the default of the key

2) CurVer - The version number (AutoCAD.Application.23)

 

Hope that helps.

 

0 Likes