Problem with Word Automation on Server


#1

I recently install UiPath Studio on my desktop and on a MS Server 2012 R2. Both systems have MS Office 365 installed with the same version. The Word Automation (i.e. Word Application Scope, Add Image, Export to PDF) works properly on the desktop installation, but not on the server installation. I get the following error on the server system:

If Word is not open:

Message: Error openning document, make sure Word application is installed
Source: Word Application Scope
Exception Type: Exception

If I open Word:

MIPSReport02 has thrown an exception

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)).
Source: Word Application Scope
Exception Type: InvalidCastException
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)

Has anyone seen this issue?


#2

Well, there’s nothing like the satisfaction of finding the solution to your own problem. Microsoft has indicated that this error results from a registry entry that contains improper version information. We performed a “repair” on the MS Office installation and that corrected the problem.

Now we have happy bots!