0

Hi i am using c# code for creating xlsx file. i have added the reference to my bin for Microsoft.Office.Interop.Excel Version 12.0.0.0

It Works ok on my local machine. But when i upload it to the server it throws the error in the page where i am creating the xlsx file "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)). " can anybody plz help

2
  • As Ben Robinson suggests, this error would indicate that Excel is not installed on the server. One thing you could do to remove this dependency, if it's an option, is to create CSVs instead of xlsx; this is an open format and can be opened and manipulated by Excel. Commented Jan 25, 2012 at 14:45
  • 1
    In general you shouldn't be using Excel automation on a server. There's plenty of libraries in this question you can use instead. Commented Jan 25, 2012 at 15:02

2 Answers 2

3

You are getting the error because excel isn't installed on the server.

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

Comments

1

You shouldn't be automating Office in ASP.NET. It can lead to myriad performance and scale issues on your server. Office itself is designed for interactive desktop usage, not unattended execution in a non-GUI app. Here is the authoritative reference from MS on the matter:

http://support.microsoft.com/kb/257757

With that being said, there are third-party libraries designed specifically for manipulation of Excel in ASP.NET. OfficeWriter is one example:

http://www.officewriter.com

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.