Click here to Skip to main content
15,880,796 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Am getting below error when i try to create excel file in server using excel interop c#

System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

My code is working in my local system, But when i try to deploy and runs the same am getting this error ?
What is the solution ?
Posted
Comments
Kornfeld Eliyahu Peter 19-Oct-14 9:49am    
You have no Excel on the server!?
Am Gayathri 20-Oct-14 3:12am    
No

Um.

You do realize that to use InterOp to Excel, you need to have Excel installed on the server, don't you?
And if you don't, you get exactly the error you are seeing?
And that almost no webservers have any part of Office installed by default?

Seriously, you don;t want to try and do interop in a production environment, because it s very unlikely that the app you want will be installed - and you can't access any installation on the client for security reasons.

Depending on exactly what you are trying to achieve, you might be better off looking at Excel file writer assemblies - there are quite a few of them out there, and some are quite good.
 
Share this answer
 
Read the section under "More Information" in this article[^].

Doing interop on any Office app is a bad idea in a web application.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900