System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Word._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{000

System.InvalidCastException: Unable to cast COM object of type ‘System.__ComObject’ 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: The RPC server is unavailable. (0x800706BA). at UiPath.Word.Activities.WordInteropActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at UiPath.Word.Activities.WordReplaceText.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
what to do?

Hey @Mani_Kumar ,
I can suggest:

  1. Ensure that Microsoft Word is properly installed on the machine where the UiPath Robot is running.
  2. Ensure that your UiPath.Word.Activities package is up to date.
  3. Restarting the RPC (Remote Procedure Call) service might help. You can do this through the Services application in Windows.
  4. Reboot Your System.

Hello,

So the first thing that i would do in your case would be to run the “Office repair tool” ( Tools-> Apps )

Also it would be most beneficial if you could provide some basic information like

  • Studio version
  • Office version
  • And logs ( %localappdata%\UiPath\Logs )

Hope this helps ,
Dragos.

Also, try installing Studio 23.10.3 and use the Repair Tool for Microsoft Office tool, or get the tool from here https://download.uipath.com/UiPath.MicrosoftOffice.Tools.zip and run it as administrator in the imapcted machine, then restart the machine.