Word error


#1

Hi!

I have problem with Word appl. When I use Word application scope to get some text into a document, evereything seems fine, the robot does as instructed, no problem in Output either. But in Event Viewer an error is registered:

{“message”:“System.Runtime.InteropServices.COMException (0x800401E3): Operation unavailable (Exception from HRESULT: 0x800401E3 (MK_E_UNAVAILABLE))\r\n at System.Runtime.InteropServices.Marshal.GetActiveObject(Guid& rclsid, IntPtr reserved, Object& ppunk)\r\n at System.Runtime.InteropServices.Marshal.GetActiveObject(String progID)\r\n at UiPath.Word.WordDocument…ctor(String documentPath, Boolean createNew)”

UiPath version: 2018.3.3
UiPath.Word.Activities v 1.3.0
Word 2016
OS: windows 64

I tried on different machines but the result is the same. Any ideas?


#2

Hi @NHL

In the “Import” section check “microsoft.office.interop.word” is there or not? If not import it!!
Check “project.json” file is getting updated with the latest package versions and also check in your run time machine whether the activites are dropped in the right directory or not!!


#3

Hi,
@ChagantiAkhil Thanks for your answer, but after I imprted “microsoft.office.interop.word” and checked that project.json, which is uppdated, I got the same error.
I checked also in .local\AllDependences and .local\PackageCache, if it is what you meant. The new import was registered there too.

Any other ideas?


#4

@NHL - Can you check this post? Check the step 3 in this.


#5

Thank you @sreenivasm,
I have tested the suggestion, but no success. :frowning:

The problem seems to be usage of Windows Application scope. If I use Start Process and start Word that way, I do not get the error. Weird!

Maybe, UiPath staff can help, as it seems to be platform error?


#6

@NHL - I tried using both Windows application scope to append text to a word doc and without it, and I did not see any errors in Windows Event Viewer. But I am using Studio 19.1.0. Looks like UiPath might have fixed the issue you are reporting in the new version of Studio.


#7

Hi @NHL
What is the version of studio you are using and the run time machine orchestrator version?
Are those same…!!
Check in this path C:\Users%username%.nuget\packages\


#8

Hi,
I do not use Orchestrator. It is stand alone robot.
On the suggested path I found this:

I use RDP to get to the server, if it matters.


#9

No need to navigate inside uipath, just packages directory is enough…!!
Inside packages folder you can find all your installed packages…!!


#10

Yes, and there I find UiPath.word.activities and UiPath.mail.activities among others (UiPath.excel.activities, UiPath.system.activities…)
Anyhow I have problem with System.Runtime.InteropServices.COMException för both GetOutlookMailMessages and Word Application Scope.

Do you want me to check versions of packages inside the directories?


#11

Try checking it…
If still the issue persists, try upgrading your studio to latest version and see.
What is the version of .net framework which is installed in your machine ?


#12

.net framework version 4.7


#13

Solution:
In order to avoid the error, I had to make workaround:

Exchange Word Application Scope to Start Process activity (set path to Winword.exe in File Name property and path to word file to write to in Argument property. If the path includes whitespace, you may need to use chr(34) befor and after path string t ex: chr(34)+“C:\Documents\My Files\My test file.docx”+chr(34) )

Use Attach Window activity to do what you want in Word (write into, paste,…).

Use Close Application activity to close Word file and Word App.