locked
Error Exporting Excel IIS7 RRS feed

  • Question

  • User1132102078 posted

    I am having problem in exporting excel over IIS

    First I got the following error. ( Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application();) <-- cause the error

    System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).

    I fixed it 

    Then, another problem came out. ( excel.Workbooks.Add();) <-- cause the error.

    System.Runtime.InteropServices.COMException (0x800A03EC): 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. at Microsoft.Office.Interop.Excel.Workbooks.Add(Object Template)

    How could I fix this problem? I am not opening much file...don't know why? 

    Are there any alternative to export excel? I need the excel to be exported in static method which will be called from PageMethods. So, generate table and export using http seems impossible. 

    Any idea? 

    If possible to maintain using Interop would be the best ...

    Thank You

    Tuesday, September 23, 2014 4:26 AM

All replies

  • User1508394307 posted

    Quote: http://support.microsoft.com/kb/257757/en-us 

    Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

    Also, using Excel on a server might be a license issue.

    A question about export has been asked and answered many times on this forum, just search

    http://forums.asp.net/t/1929266.aspx 
    http://forums.asp.net/t/1573064.aspx 

    Tuesday, September 23, 2014 4:31 AM