tags:

views:

1765

answers:

2

Hello.

I have created an application that uses Microsoft.Office.Interop.Excel, in my local and testing environments everything worked fine, but the app does not work in the production environment.

Turns out I have Office installed locally, as does the Test server, however, the production server does not have Excel installed.

I really can't go back and change my code, however, I would really not like to have to install Excel on the production server.

Do I have any other options other than installing Office Excel on the production server to get the application working?

Thanks, Appreciate your assistance. Steven

+3  A: 

Office Interop does require that Office be installed on the server.

In the more general case, you do not need Excel to create worksheets, and you should avoid any solution that requires it for web use. That includes office interop: it doesn't scale in a web environment.

See this question for more options:
http://stackoverflow.com/questions/150339/generating-an-excel-file-in-asp-net

Joel Coehoorn
Thanks for your response, however, the application is already created, and it is an internal app, that has tons of custom formatting.
stevenrosscampbell
You might get away with it for an internal app, because you can control and monitor volume. However, I promise you that your code is fundamentally broken.
Joel Coehoorn
Or, put another way: "Don't say I didn't warn you."
Joel Coehoorn
Hey Joel. Can you please explain what you mean by 'don't say i didn't warn you'? The application works as designed, the application is internal and the excel document is only generated properly. The customer (me in this case) is happy about the result...
stevenrosscampbell
I realize that there maybe other options available to me, however, i can't now go spending a couple days rewriting the application. It works. Am i missing something? Thanks
stevenrosscampbell
Maybe the harm is in having to install Excel on the Production server?
stevenrosscampbell
Have you tested it under load? Each request will use a complete new instance of the whole excel program. You'll quickly run your server out of ram.
Joel Coehoorn
Hey Joel. Thanks again for the response, you've been a create assistance.I will look into the mass load senerio.thanks, again. Steven(You know, I wish I could go back in time and change the technological implementation, it's starting to bother me now)
stevenrosscampbell
and by create assistance, i really mean Great Assistance.
stevenrosscampbell
A: 

The Excel interop libraries work by opening the Excel application in the background to process the spreadsheet. So without updating your code, you will need to have Excel installed on the server. However using interop is a very slow and error prone solution to working with Excel from ASP.NET, the link Joel gave provides several good alternatives.

Joshua Poehls
Thanks for your response.
stevenrosscampbell