![](/img/trans.png)
[英]resolve error for Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046}
[英]Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed - 80080005
我正在使用 Interop 打開一個 Excel 實例來檢索一些數據。 但是以下行:
Application xlApp = new Microsoft.Office.Interop.Excel.Application();
給出了這個錯誤:
System.Runtime.InteropServices.COMException
HResult=0x80080005
Message=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=mscorlib
StackTrace:
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)
這在 Office 更新為 Office Pro Plus 之前有效。 在其他機器上,這是通過將身份從 DCOM 配置更改為交互式用戶來解決的。
但是我無法使它工作,嘗試了其他幾種解決方案(更改權限等),但似乎都不起作用。
請問有人遇到過這個問題並設法解決了嗎?
問題已解決。 似乎我的 Office 許可證有一個奇怪的問題。
還必須執行以下步驟:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.