Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

A strange error when using C# to develop AutoCAD2016 with VS2013

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
hbxiaogui
438 Views, 3 Replies

A strange error when using C# to develop AutoCAD2016 with VS2013

I need export some data to excel, then I use the code as follow to create an excel application

Microsoft.Office.Interop.Excel.Application xlApp = new Microsoft.Office.Interop.Excel.Application();
Microsoft.Office.Interop.Excel.Workbooks xlBooks;
xlBooks = xlApp.Workbooks;

when the code run to the red line report error : Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A(TYPE_E_CANTLOADLIBRARY))

Then I use vs2013 to create a new ConsoleApplication,paste the code above, it's running well.

And I change to use vs2010 and AutoCAD2012 , the code above also run well.

 

All above reference the same Microsoft.Office.Interop.Excel.dll

 

Can anybody help me, please.

 

 

 

3 REPLIES 3
Message 2 of 4

Set the SECURELOAD system variable to 0, and see if that changes anything.

 


@hbxiaogui wrote:

I need export some data to excel, then I use the code as follow to create an excel application

Microsoft.Office.Interop.Excel.Application xlApp = new Microsoft.Office.Interop.Excel.Application();
Microsoft.Office.Interop.Excel.Workbooks xlBooks;
xlBooks = xlApp.Workbooks;

when the code run to the red line report error : Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A(TYPE_E_CANTLOADLIBRARY))

Then I use vs2013 to create a new ConsoleApplication,paste the code above, it's running well.

And I change to use vs2010 and AutoCAD2012 , the code above also run well.

 

All above reference the same Microsoft.Office.Interop.Excel.dll

 

Can anybody help me, please.

 

 

 


 

Message 3 of 4

Thank you for reply.

I tried, but it didn't work, still cause the same error

Message 4 of 4
hbxiaogui
in reply to: hbxiaogui

finally, I found the solution.

the reason cause the error is I installed wps and then uninstall it. the software modify the interface of office.  just change them back can fix this.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report