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.
Solved! Go to Solution.
Solved by hbxiaogui. Go to Solution.
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.
Thank you for reply.
I tried, but it didn't work, still cause the same error
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.