cancel
Showing results for 
Search instead for 
Did you mean: 

Attach word - Cannot create ActiveX component.

KellyFarquhar
Level 4
Hi All, I'm having trouble with attaching word. If i step over it attaches fine but when i run the process 90% of the time it fails. I've put in a sleep and a loop so the process sleeps for 5 seconds,upto a maximum of 60 seconds, then retries the attach but the majority of times it fails with a Cannot create ActiveX component error. Anyone any ideas how i might fix this?
5 REPLIES 5

Are you using the MS Word VBO provided by Blue Prism?

Yes i am

Denis__Dennehy
Level 15
Ensure word is fully closed from your previous test run. Maybe send a kill command to winword before you start to ensure it is still not running (using the environment object).

I'm already doing that, the process kills word then opens a specific word document waits for winword, then waits for the window title and sleeps for 5 seconds before attempting to attach, if i set a breakpoint and step over the attach stage it works fine, but when running the process if fails the majority of times but on occasion will work.

luismartinez888
Level 4
Hi. Kind of an old thread but I wanted to chime in with my similar issue. I found the issue and a work around for this same problem, maybe it'll help others. I narrowed down my problem to the “Attach Instance” stage in the MS Word VBO. A little background, I use attach instance action in order to check if word is launched or not. It never fails on initial launch or on subsequent loops. However, there’s a scenario where a certain error occurs that requires me to kill word and re-launch it using the same page that has worked consistently. That’s when I get the same error as stated. Attaching word when not launched should throw a regular error that’s easily handled. For some reason, that’s not the case after killing word. By stepping into the MS Word VBO action, I noticed that the handle gets cleared as the action is launched, so when the object attempts to access the handle, there is none, and throws this ActiveX error. My solution, create a flag that’s set to true when word is killed, and add a choice stage to check for this prior to the “Attach Instance stage”. When the flag is true, this stage is bypassed and goes straight to launching Word, thus avoiding this strange issue (or possible bug).