0

I have a problem shelter my WebSite application on IIS.

I tried to generate excel file using Microsoft.Office.Interop.Excel.Application, it work in debug but when i shelter my website on IIS, the generating file not work.

I have a problem in the following instruction :

Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application();

And i have the following error :

System.Runtime.InteropServices.COMException: 'Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).'

Hm Ch
  • 43
  • 1
  • 8

1 Answers1

0

You might also want too look into https://blogs.msdn.microsoft.com/adioltean/2005/06/24/when-cocreateinstance-returns-0x80080005-co_e_server_exec_failure/

Also, do you have the Office Web Tools installed on your server?

  • The real article he should read is [Considerations for server-side Automation of Office](https://support.microsoft.com/en-us/help/257757/considerations-for-server-side-automation-of-office) – Scott Chamberlain Feb 01 '18 at 17:25
  • @ScottChamberlain .He is not asking "for it would work", "should I". He is asking for a response on why its throwing a defined error. We dont have enough information on why he chose this path so it is out of our scope to change his angle of resolving this task of generating an Excel. – Salvador Ruiz Guevara Feb 01 '18 at 17:44
  • 1
    That article has his specific error in it. See "Message 3" in the article, that is the exact error he is getting. The article explains why you get the error in the section just above the list of messages you can get. – Scott Chamberlain Feb 01 '18 at 17:47
  • i think the problem is related for user access to EXCEL.exe in IIS, but i can't find a solution for the problem – Hm Ch Feb 01 '18 at 17:59
  • @HmCh read the two documents. You are trying to start the excel app from a web page. This is highly discouraged cause of memory issues (each request to this webapp will try to open 1 client of excel), timeouts, etc. There are other alternatives to this, you can implement OWC11 in low traffic web apps but its a add-on from the Office 2003 suit specially made for publishing spreadsheets, charts, and databases to the Web. But i dont recommend it on larger apps cause of the following: https://support.microsoft.com/en-us/help/317316/limitations-of-office-web-components-when-used-server-side – Salvador Ruiz Guevara Feb 01 '18 at 19:23