ASP.NET and Excel
-
Dear all, I am having trouble with generating Excel when the application is placed on a webserver. Locally, it works fine but unfortunately, it gives the following error message when placed on a webserver. Actually, I am reading each node in a Treeview for generating the Excel. I am using the Microsoft Excel Object 11.0 as reference and the classes in there (Application, Workbook, Sheets...) Please help me in resolving this problem if possible. Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80080005. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: 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. Source Error: Line 241: // Excel objects initialisation Line 242: GC.Collect();// clean up any other excel guys hangin' around... Line 243: oXL = new Excel.Application(); Line 244: oXL.Visible = false; Line 245: Source File: c:\TrouxLicenses\Default.aspx.cs Line: 243 Stack Trace: [COMException (0x80080005): Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80080005.] _Default.GenerateExcel() in c:\TrouxLicenses\Default.aspx.cs:243 _Default.btnExportToExcel_Click(Object sender, EventArgs e) in c:\TrouxLicenses\Default.aspx.cs:209 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo stBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
-
Dear all, I am having trouble with generating Excel when the application is placed on a webserver. Locally, it works fine but unfortunately, it gives the following error message when placed on a webserver. Actually, I am reading each node in a Treeview for generating the Excel. I am using the Microsoft Excel Object 11.0 as reference and the classes in there (Application, Workbook, Sheets...) Please help me in resolving this problem if possible. Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80080005. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: 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. Source Error: Line 241: // Excel objects initialisation Line 242: GC.Collect();// clean up any other excel guys hangin' around... Line 243: oXL = new Excel.Application(); Line 244: oXL.Visible = false; Line 245: Source File: c:\TrouxLicenses\Default.aspx.cs Line: 243 Stack Trace: [COMException (0x80080005): Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80080005.] _Default.GenerateExcel() in c:\TrouxLicenses\Default.aspx.cs:243 _Default.btnExportToExcel_Click(Object sender, EventArgs e) in c:\TrouxLicenses\Default.aspx.cs:209 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo stBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102