0

I have developped an asp.net application using microsoft office interop excel on my local machine, everything worked well, an excel file was build.

When I deploy the application on my server and run it, I am getting the following exception :

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))

I have done some research on forums, I know that it's probably because excel is missing on the server, however I am not able to find an appropriate solution, knowing that install excel on the server is not really possible. And also knowing that I would like to keep interop as my library.

Does anyone have a solution?

2
  • 3
    Office interop requires that office be installed on the machine that code is running on, your code just won't work without it. Commented Nov 20, 2014 at 14:17
  • 1
    Also depending on the server OS, there may be many hoops to jump through to get Excel to actually start properly when called. Windows 2012 is particularly buttoned down and we could only get it to work with logging into the box as the service user. Which is not good and led us to use another solution for working with Excel files. Commented Nov 20, 2014 at 14:20

1 Answer 1

4

First, what ever you are trying to do, try to do it without using Excel (or any Office) interop in ASP.NET. Microsoft strongly discourages it, as it might not work as you expect.

There are plenty possibilities to do this without the 'client application' Excel, for example EPPlus.

Second, the problem with your code is the lack of Office installed or the wrong version of Office (also consider 32- or 64-bit platform versions).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.