UiPath - issue - "Make sure Excel is installed.the QueryInterface call on the COM component for the interface with IID '{000208D5-0000-0000-C000-000000000046}' failed due to the following error: In "


【問題描述】

在 UiPath (2019.3.0 Community Edition) 使用 Excel Application Scope + Read Cell 讀取 Exce l時報錯

這個問題從 4/8/2019 17:47 起,到今天 4/15/2019 17:06,困擾了我一周,終於解決了!

下圖是 Designer panel 的 workflow 和 異常截圖

 

以下是詳細的報錯信息:

19.3.0+Branch.master.Sha.5fdb43627d7d3c011018bb545ddf9470210d44a9

Source: Excel Application Scope

Message: Error opening workbook. Make sure Excel is installed.

Exception Type: System.Exception

An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.Exception: Error opening workbook. Make sure Excel is installed. ----> System.InvalidCastException: Unable to cast COM object of type 'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type 'Microsoft.Office.Interop.Excel._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{000208D5-0000-0000-C000-000000000046}' failed due to the following error: Interface not registered (Exception from HRESULT: 0x80040155).
   at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
   at Microsoft.Office.Interop.Excel.ApplicationClass.set_SheetsInNewWorkbook(Int32 RHS)
   at UiPath.Excel.WorkbookApplication.StartNewApplication()
   --- End of inner ExceptionDetail stack trace ---
   at UiPath.Excel.WorkbookApplication.StartNewApplication()
   at UiPath.Excel.WorkbookApplication.InitializeExcelApp()
   at UiPath.Excel.Activities.ExcelApplicationScope.<>c.<.ctor>b__44_0(WorkbookArguments args)
   at UiPath.Excel.Activities.ExcelApplicationScope.Execute(NativeActivityContext context)
   at System.Activities.NativeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
   at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
   at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

 

問題關鍵點:

This operation failed because the QueryInterface call on the COM component for the interface with IID '{000208D5-0000-0000-C000-000000000046}' failed due to the following error: Interface not registered (Exception from HRESULT: 0x80040155).

 


 

 【解決方法】

可能的原因(不太確定):

 之前電腦里安裝了一個 32位的 Visio,但是安裝的 office 365 是 64位的,引起注冊表沖突

 

嘗試過,但不好用的解決方法:

  • 刪除32位的 Visio,然后在Programs and Features - Office 365 - Change (聯網) 修復 Office 365,重啟 

 

 最終解決方法,請依次操作下方鏈接的內容:

0x80040155 - Interface not Registered

Fix the Interface

Fix the TypeLib

Ensure MSOUTL.LIB is Registered (regtlibv12.exe "C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE")

p.s  上邊文章中出現的 {00062FFF-0000-0000-C000-000000000046} 是 Outlook 的,如果你和我一樣遇到的是 Excel 的問題,只需要將其換成 {00020813-0000-0000-C000-000000000046} 即可


 

【曲線救國的方法】

 Excel Application Scope + Read Cell 的搭配是需要安裝 Excel 軟件的(當然啦,上邊的 Issue 就是在安裝了Excel的情況下還是出現問題了),如果嫌解決起來太麻煩,還有另外一個曲線救國的方法,就是使用不需要安裝 Excel 的 Read Cell 的 activity (這個方法無論如何都不會報錯),請注意,雖然這兩個方法都叫 Read Cell,但所屬的包是不一樣


 

參考

https://github.com/phw198/OutlookGoogleCalendarSync/issues/220

https://forum.uipath.com/t/uipath-dont-seem-to-recognize-excel-on-my-computer/102882 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



猜您在找 對 IID 為“{000208D5-0000-0000-C000-000000000046}”的接口的 COM 組件調用 QueryInterface 因以下錯誤而失敗 親測解決!此操作失敗的原因是對 IID 為“{000208D5-0000-0000-C000-000000000046}”的接口的 COM 組件調用 QueryInterface 因以下錯誤而失敗: 庫沒有注冊。 C# Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 此操作失敗的原因是對 IID 為“{000208DA-0000-0000-C000-000000000046}”的接口的 COM 組件調用 QueryInterface Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005 拒絕訪問。 關於Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005的解決辦法 無法將類型為“Excel.ApplicationClass”的 COM 對象強制轉換為接口類 型“Excel._Application”。此操作失敗的原因是對 IID 為“{000208D5 -0000-0000-C000-000000000046}”的接口的 COM 組件調用 QueryInterface 因以下錯誤而失敗: 加載類型庫/DLL 時出錯。 (異常來 自 HRESULT: 【Excel】Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} 部署到服務器后,導出Excel發生錯誤Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046}
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM