1

I have generated excel file dynamically using c# code where i refer Microsoft.Office.Interop.Excel

on local machine everything working fine.

but when i deployed my application on Windows Azure i'm getting following error when I try to generate excel file and save it.

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)
1
  • 2
    DO you have excel on your azure instance? Commented Jul 2, 2014 at 10:31

2 Answers 2

4

1 month ago, i was facing the same issue, and solved by creating the ExcelWriter class in my code.

Instead of using MS Excel dll for generating excel files you can create your own excelwriter in your code.

below link can solve your problem(I guess).

http://www.codeproject.com/Articles/33850/Generate-Excel-files-without-using-Microsoft-Excel

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

1 Comment

@SulabhAgarwal. Yep, I agree (though I would base it on openxml these days). However, "rewrite your code" (who knows if the OPs code is as lovely as modular as yours) can be a bit of a daunting answer to deployment problems.
3

I suspect you may need to install office on the azure instance (which is not recommended by the way because excel is a clinet application... etc etc).

Here's a guide for installing it: Installing Third Party Software on Windows Azure You've got three options: Start up task, RDP-ing or VM Role. I believe VM role is the suggested way.

Maybe use openXML next time you want to make excel files from a server application. Or spend some money to support pre-openXML files.

You may encounter licencing issues by installing office on your server, incidentally, I am not an expert here. Anyone else care to comment?

3 Comments

I have no experience with azure but doesn't he just need to deploy the Microsoft.Office.Interop.Excel.dll with his app? So their is no need to install the office suite.
@Sascha Are you sure? I thought the interop dll is not much use without the application.
@Nathan Cooper I'm not sure but it seems like you are right then after searching I stumbled across this in MSDN (Notice the question of David (nearly at the end) and the dedicated answer of E. Crowford (currently last post)). Have a nice day.

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.