I got this problem when trying automate word. Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY))

I got this problem when trying automate word

Runtime execution error body { font-family: Segoe UI; margin: 0; border-top: 1px solid #d9d9d9; } img#warning { float: left; width: 28pt; } div#header { min-height: 80pt; max-height: 290pt; margin: 16pt; margin-top: 8pt; } p { margin: 0pt; } div.action_info { overflow: hidden; border-top: 1px solid #d9d9d9; width: 100%; position:absolute; bottom:0; background-color: #f5f5f5; } p.action_info { float: left; margin: 8pt; margin-left: 44pt; } .btn { cursor:pointer; display: inline-block; font-weight: 400; color: #242424; background-color: #e8e8e8; border-color: #c5c5c5; text-align: center; vertical-align: middle; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; border: 1px solid; padding: 2pt; line-height: 1.5; transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out; } .btn-primary { border-color: #0073ce; } .img-resize{ height: 75px; width: 210px; overflow: hidden; border: 1px solid #c5c5c5; } .img-resize img{ max-width: 100%; object-fit: cover; } #problem-element-image-container { align-items: center; display: flex; } #action_info_text{ overflow: hidden; position:absolute; bottom:44pt; left: 16pt; color: #707070; background-color: #FFF; } #buttons_master_container{ width: 80%; float:right; margin: 8pt; margin-right: 12pt; } div.ImageClear{ clear:both; } #appImagesContainer{ display: flex; } div#buttons_container { clear: both; } #buttons_container input { float: right; margin-left: 8pt; padding-left: 5px; padding-right: 5px; } div#arrow-container { width: 48px; } div.center-align { position: relative; } div.center-align img{ position: absolute; top: 0; bottom: 0; margin: auto; left: 0; right: 0; } .modal-image { border-radius: 5px; cursor: pointer; transition: 0.3s; } .modal-image:hover {opacity: 0.7;} .modal { display: none; position: fixed; z-index: 1; padding-top: 100px; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgb(0,0,0); background-color: rgba(0,0,0,0.9); } .modal-content { margin: auto; display: block; max-width: 700px; } #caption { margin: auto; display: block; width: 80%; max-width: 700px; text-align: center; color: #ccc; padding: 10px 0; height: 150px; } .modal-content, #caption { animation-name: zoom; animation-duration: 0.6s; } @keyframes zoom { from {transform:scale(0)} to {transform:scale(1)} } .close { position: absolute; top: 15px; right: 35px; color: #f1f1f1; font-size: 40px; font-weight: bold; transition: 0.3s; } .close:hover, .close:focus { color: #bbb; text-decoration: none; cursor: pointer; } @media only screen and (max-width: 700px){ .modal-content { width: 100%; } } #SkipIterationContainer { /* display: none; / display: none; } #ExcelCardDetailsContainer { / display: none; / display: none; } #OutlookCardDetailsContainer { / display: none; / display: none; } #ApplicationCardOnlyDetailsContainer { / display: none; / display: none; } #ApplicationCardWithElementDetailsContainer { / display: none; / display: none; } #ErrorPathContainer { / display: none; */ [ERRORPATH_CONTAINER_VIS_PLACEHOLDER] } .scrollable { overflow-y: auto; } .unscrollable { overflow: hidden; } #problem-desc { white-space: pre; }

Unable to cast COM object of type ‘Microsoft.Office.Interop.Word.ApplicationClass’ to interface type ‘Microsoft.Office.Interop.Word._Application’. This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{00020970-0000-0000-C000-000000000046}’ failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).

Hi @irham.nirwana

Could you provide a screenshot of your project?

Hello,
Besides the screenshot of your project can you please provide the following :

  • The version of StudioX that you are using

  • The version of the Office Suite that you are using

  • And I would be most useful if you could provide us with the logs. They are usually found in %localappdata%/UiPath/Logs

Regards,
Dragos.

  • the version of studio X: 20.4.0-beta.472
  • Office Suite: 365 pro plus
  • an error message:

Source: Use Word File

Message: Unable to cast COM object of type ‘Microsoft.Office.Interop.Word.ApplicationClass’ to interface type ‘Microsoft.Office.Interop.Word._Application’. This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{00020970-0000-0000-C000-000000000046}’ failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).

Exception Type: System.InvalidCastException

RemoteException wrapping System.InvalidCastException: Unable to cast COM object of type ‘Microsoft.Office.Interop.Word.ApplicationClass’ to interface type ‘Microsoft.Office.Interop.Word._Application’. This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{00020970-0000-0000-C000-000000000046}’ failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).
at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
at Microsoft.Office.Interop.Word.ApplicationClass.get_Documents()
at UiPath.Word.WordDocument
ctor(String documentPath, Boolean createNew)
at UiPath.Word.Activities.WordApplicationScope.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)

Can you send me as personal message the entire log ? Maybe it something in the upstream :slight_smile:
Dragos.

ok

09:37:31.6241 => [ERROR] [UiPath.Studio.Shared.Logging.OutputLogger] [5] System.InvalidCastException: Unable to cast COM object of type ‘Microsoft.Office.Interop.Word.ApplicationClass’ to interface type ‘Microsoft.Office.Interop.Word._Application’. This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{00020970-0000-0000-C000-000000000046}’ failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).
at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
at Microsoft.Office.Interop.Word.ApplicationClass.get_Documents()
at UiPath.Word.WordDocument
ctor(String documentPath, Boolean createNew)
at UiPath.Word.Activities.WordApplicationScope.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)
09:37:42.5749 => [ERROR] [UiPath.Studio.Shared.Logging.OutputLogger] [5] System.InvalidCastException: Unable to cast COM object of type ‘Microsoft.Office.Interop.Word.ApplicationClass’ to interface type ‘Microsoft.Office.Interop.Word._Application’. This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{00020970-0000-0000-C000-000000000046}’ failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).
at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
at Microsoft.Office.Interop.Word.ApplicationClass.get_Documents()
at UiPath.Word.WordDocument
ctor(String documentPath, Boolean createNew)
at UiPath.Word.Activities.WordApplicationScope.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)

As a matter of update, this was handled in two ways in 20.10:

  • you now get a better error message
  • we introduced a repair tool that should fix this issue

already upgraded into 20.10 version but error still exist.
where i can find the repair tool, i just got Excel Repair tool

Hi @irham.nirwana

You can find the repair tool under Tools in Studio :slight_smile: It is called Repair Tool for Microsoft Interop.

I mentioned before, Repair Tool seems for Excel but my error related to Word Automation.
I’ve tried Repair Tool and Word Automation error remain the same

hello
which 20.10 version are you running? can you please update to 20.10 beta754 which was uploaded this monday? As @loginerror said you have the tool to repair also the word installation.

you need to browse to your word exe file

let me know how it goes

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.