我想一个.xls文件转换为使用Microsoft.Office.Interop.Excel.Workbook
类服务器端的.xlsx文件如下:服务器执行失败(异常来自HRESULT:0x80080005(CO_E_SERVER_EXEC_FAILURE))
workBook.SaveAs("FILENAME_HERE", XlFileFormat.xlOpenXMLWorkbook, Type.Missing, Type.Missing, Type.Missing, Type.Missing, XlSaveAsAccessMode.xlNoChange, Microsoft.Office.Interop.Excel.XlSaveConflictResolution.xlLocalSessionChanges, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
和我得到以下错误:
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)). : System.Runtime.InteropServices.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)).
at System.Runtime.Remoting.RemotingServices.AllocateUninitializedObject(RuntimeType objectType)
at System.Runtime.Remoting.Activation.ActivationServices.CreateInstance(RuntimeType serverType)
at System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(RuntimeType serverType, Object[] props, Boolean bNewObj)
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at CALLING_METHOD_IN_MY_LIBRARY_HERE...
问题是仅在暂存服务器上发生此错误;在我的本地机器上,它工作正常。
的事情,我已经在测试服务器上的尝试:
- ** 1)运行DCOMCNFG打开组件服务
2)展开组件服务 “ - >” 计算机 “ - >”我的电脑 “ - >” DCOM配置“
3)找到 ”Microsoft Excel应用程序“
4)右键打开日。 Ë属性对话框
5)单击“安全”选项卡上,
6)“启动和激活权限,配置权限,必须添加权限 - 身份下管理员联系用户(该用户),交互式用户和运行启动用户
7)。启动和激活权限+访问权限+配置权限=>添加IIS_IUSRS +网络服务具有完全控制研究**
2. 改变了.xls文件,从“任何CPU”,以转换项目的构建“86 “在我的本地机器上,并在服务器上发布这个库。
有人想出了如何解决这个问题?我现在正在努力解决这个问题2天。
我知道这看起来很傻,但你有没有在服务器上创先争优正确安装? –
是的,我在服务器上安装了Excel。 –
您是否找到解决方案? –