簡體   English   中英

檢索具有 CLSID {00024500-0000-0000-C000-000000000046} 的組件的 COM 類工廠失敗 - 80080005

[英]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 許可證有一個奇怪的問題。

還必須執行以下步驟:

  1. DCOM Config > Office Licensing COM Server 16. 右鍵單擊​​ > 屬性
  2. 在身份選項卡中,更新為交互式用戶
  3. 在“安全”選項卡中,向在“啟動和激活權限”部分中用作應用程序池身份的用戶授予“本地啟動”權限。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM