生成EXCEL 的时候有时候会出错
Server Error in '/MTL' Application.
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)).
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 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).
Source Error:
Line 1408: {
Line 1409: object missing = System.Reflection.Missing.Value;
Line 1410: Excel.Application excel = new Excel.Application();//lauch excel application
Line 1411: Excel._Workbook xBk = null;
Line 1412: Excel._Worksheet xSt = null;
Source File: e:\SSL\MTL\ApplyMaterialTestEdit.aspx.cs Line: 1410
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 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).]
ApplyMaterialTestEdit.UpdateExcel(String strFileName) in e:\SSL\MTL\ApplyMaterialTestEdit.aspx.cs:1410
ApplyMaterialTestEdit.btnExcel_Click(Object sender, EventArgs e) in e:\SSL\MTL\ApplyMaterialTestEdit.aspx.cs:1405
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9796650
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +211
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1696
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4494.0