Failed to call COM component when "Set text" on IE


I am facing an error, “Error HRESULT E_FAIL has been returned from a call to a COM component”, when I try to “Set text” into an object on Internet Explorer.

Following is my robot.

  1. Log in to a legacy web-based system (Only available on IE)
  2. Simulate clicking a menu and jump to lv2 page
  3. Simulate clicking a menu and jump to lv3 page
  4. Set text into an object
  5. Simulate clicking an image anchor to bring up an input-help window
  6. Set text into an object of the window opened in step 5.
  7. Simulate clicking a button to submit the data

The result is that, both step 4 and step 6 failed. “Error HRESULT E_FAIL has been returned from a call to a COM component” showed.

When I tried to find the reason, I found,
a. Everything will be okay when I run just step 4 ~ 7.
b. I tried to add “On element appear” to prevent “Set text” runs before the page becomes ready, but it didn’t help.
c. I use “Set to clipboard” > “Set focus” > “Send hotkey (Ctrl+v)” instead of “Set text”, it succeeded.

Although the method “c” above helps avoid that error, I am not willing to do it every time I want to “Set text” into an element.

Do you have any idea why the error happens and how solve it correctly?

Thanks in advance


Try using Type into activity instead of set text with below properties.

  • Delay before - 1000.
  • Wait for ready - Complete.
  • Click before typing - true.

@Vivek_Arunagiri Thank you for your advice.
Actually, this was not UiPath’s problem, it was mine.
The “Set text” activity is in a sub sequence which is called by main sequence.
And I’ve forgotten to set input arguments before using them.
Now the problem was solved after I set the arguments.

There may be an improvable point in UiPath. It is that, when an argument is not correctly initialized, UiPath could show some messages to notify the author. :wink:

And @Vivek_Arunagiri, thank you again!

Best regards,

1 Like