Error loading type library/DLL 0x80029C4A TYPE-E-CANTLOADLIBRARY

Error loading type library/DLL 0x80029C4A TYPE-E-CANTLOADLIBRARY

Anonymous
Not applicable
43,983 Views
11 Replies
Message 1 of 12

Error loading type library/DLL 0x80029C4A TYPE-E-CANTLOADLIBRARY

Anonymous
Not applicable

I have an application I wrote that has been working for a long time and is not giving me an error.  My application uses COM to automate AutoCAD 2014.  My dev machine is running Windows 8.1 with VS 2013.  

 

When my application gets to the ModelSpace line in my code the application throws an error Error loading type library/DLL 0x80029C4A TYPE-E-CANTLOADLIBRARY.

 

 error.jpg

0 Likes
Accepted solutions (1)
43,984 Views
11 Replies
Replies (11)
Message 2 of 12

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

welcome @forums.autodesk.com!

 

Can you show screenshots from your references (showing the path to the *.interop.dll) and the code line that stops the code from working? (or better if possible a sample solution so we can start it without trying to get a situation similar to yours)?

Just to make sure: you have tried that code also with a new drawing, not containing any proxies or so.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 3 of 12

Anonymous
Not applicable

Below is the reference used in my code.  I've been using this code for years and just tweaking it for the different versions of AutoCAD we have deployed.  

Before running my code I started with a new, blank AutoCAD drawing open.  The program errors out when it gets to the line MS = DOC.ModelSpace.  

 

ref.jpg

 

code.jpg

0 Likes
Message 4 of 12

norman.yuan
Mentor
Mentor

You need to change "Embed interop types" from "True" to "False" (MS makes VisualStudio 2012 or later to automatically set "Embed interop types" to "True" when a COM reference is added to the project. This specifically works with MS Office applications, but DOES NOT work with AutoCAD COM).

 

Also, it looks like you did not use AutoCAD interop assemblies from Autodesk (they can be dowloaded from ObjectARX SDK), and they can also be found in AutoCAD installation folder: Autodesk.AutoCAD.Interop/Common.dll). In older version of AutoCAD, these PIA were installed in GAC, but since AutoCAD2012(2013?), it is no longer the case any more.

 

It is recommended to use Interop assemblies from Autodesk (either from ObjectARX SDK, or ifrom AutoCAD installation folder). In this case, make sure the references to these DLLS is set "COPY LOCAL" as False (because they are already in the same folder as acad.exe.

 

However, in your case, it looks like you added AutoCAD COM reference by selecting "COM" tab in Refernces dialog box, select AutoCAD COM type libabries, and let VisualStudio generate the .NET interop assemblies for you. This is fine and you should not have issues here, but you need to make sure to set "Copy Local" to "Ture"

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 5 of 12

Anonymous
Not applicable

I'm still trying to find a solution to my problem.  

 

I've attached a small sample app that crashes when it gets to the line:

Dim m As AcadModelSpace = d.ModelSpace
0 Likes
Message 6 of 12

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

your project is defined to create an EXE and to use 32bit ... is your AutoCAD also running 32bit?

When changing it to 64bit and then start my AutoCAD 2014, then your form and click your Button1 all works fine on my side with your project.

 

[EDIT] Sorry, your project also works well when I compile the EXE to x86 [/EDIT]

 

- alfred -

 

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 7 of 12

Anonymous
Not applicable

From the BUILD menu I selected Configuration Manager.  I changed the Active solution platform to x64.  Is that what I need to change to make it a 64-bit app?  The program still crashes on me even with Platform set to x64.

0 Likes
Message 8 of 12

Alfred.NESWADBA
Consultant
Consultant
Accepted solution

Hi,

 

I guess you have not seen my EDIT, I tried it also with 32bit (x86) and it worked too (what I didn't expect first).

 

What would I do now:

  • first I would not run late-binded, that might show you type conflicts while compiling, not in runtime mode.
  • then try the same exe with another user account (maybe admin permissions as well as disabled security options like antivirus or malware defending software)
  • also make sure you really have a drawing open in AutoCAD and not a command active
  • then I would try the same from VBA from MS-Word or MS-Excel, just to see the COM components are registered well on your system
  • and at least I would try a repair installation of AutoCAD.

 

Good luck, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 9 of 12

Anonymous
Not applicable

My application worked correctly with logged into my dev machine as administrator.  

 

I deleted my user profile and ran the repair from the Control Panel on AutoCAD.  My app is now working again when I'm logged in with the normal Windows account.

 

Thanks for pointing me in the right direction to get this working again!

Message 10 of 12

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

you are welcome, good to know you got it working ... and thx for describing what you did, this will hopefully help others in the future!

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 11 of 12

Anonymous
Not applicable

Hello, I am also getting this error code but the problem stems from my Office 365.  I use Samsung software (Smartswitch) to synch my calendars and contacts between my phone and computer and having been doing this for the past 6 months. 

 

Two days ago I experienced issues with Excel and called the Microsoft help desk. They decided to do a hard uninstall going into various registries and folders and deleting files.  When 365 was reinstalled I began getting this error when I tried to use Smartswitch to synch.  I believe a registry item or file was deleted during the uninstall effort, that had been there before.  I'm pretty sure it's an Office 365 issue although they have sent me to Samsung because they cannot solve the issue. I have called back and am on my third help desk person.  Both my computer (Microsoft Pro 4) and the download are 64 bit.

 

Any idea what has happened?

 

To give a little more background, I've been synching with Office 7 for the past six years using various synch apps as my phones have changed, with no problem. I am new to Office 365 and this is the first time I have not been able to synch Outlook data. 

 

Thanks

0 Likes
Message 12 of 12

Ed__Jobe
Mentor
Mentor

Hello, I understand that you're probably frustrated and searching the net for solutions, but if it doesn't have anything to do with AutoCAD, we probably can't help you too much. You can get the same error message for a great number of reasons. Something probably did get mistakenly deleted. You said you reinstalled Office, but have you tried reinstalling Smartswitch also?

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes