Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

We have developed two projects WCF and ASP.net Website.The WCF service consists of code that performs excel generation it has something like

Excel.Application xlapp=new Excel.Application();
xlapp.visible=true;
//get data from dataset and process it and then write it to excel

This WCF service is hosted in my ASP.net website on a click button in web page

However when I run this service and asp.net on IIS 7 whole lot of error's are generated

few of the errors are as follows

Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005."

Then after giving permissions

Application. Microsoft Office Excel cannot open or save any more documents because
there is not enough available memory or disk space. • To make more memory available,
close workbooks or programs you no longer need. • To free disk space, delete files
you no longer need from the disk you are saving to

because of all these errors I am not able to run excel on IIS 7

I have tried all the methods right from Permissions to Authentication but it generates error I am running XP on my local machine and Win 7 on IIS machine (Is this the problem of WIN 7?)

also this link says Server side Office automation is not supported at all

Isnt there any simple approach to start excel in IIS 7 ?? Or may be I should call excel in my ASP.net website than the WCF service...

Thanks all

share|improve this question

3 Answers 3

up vote 3 down vote accepted

Automating Excel should be done with the OpenXML library if possible, since it does not require an instance of Excel to be running, which is questionable at best for server-side processing.

share|improve this answer

Bas Brekelmans is right. You should go for OpenXML. I spend something like 2-3 days looking for a solution. There are many work arounds. Creating a new path in System32/SysWOW64.

http://social.msdn.microsoft.com/Forums/en-US/b81a3c4e-62db-488b-af06-44421818ef91/excel-2007-automation-on-top-of-a-windows-server-2008-x64

Another solution is through dcomcnfg.exe -> Component Services->Computers->My Computer->DCOM Config->Microsoft Word->Right Click->Properties->Security&Identity.

You'll find a lot of questions about it, but might find 1-2 replies which work.

I've one server which works properly with the Automatisation of Office, on the other server it doesn't, can't tell you why. Been troubleshooting for weeks the issue.

Also server-side automatisation is a feature that isn't supported by Microsoft Servers(shouldn't be).

Also, look under which version you compile your project, if it's x64 or x86.

share|improve this answer

Bas Brekelmans and mike27015 are right.

You should never go for COM component in asp.net project. Better to use OpenXml library or some third part library like NPOI NPOI is free and supports both xls and xlsx(open xml) type.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.