Hotkeys in Excel

I’m using hotkeys within an excel application scope. Most of the time we’re receiving a timeout error on the hotkey as follows:

“Message: Timeout reached.
Source: Send hotkey ‘NetUIHWND’
Exception Type: ElementOperationException”

I believe the issue is the Excel window is not visible on the screen, so the bot is unable to identify the window and apply the hotkey against it. In the Excel application scope, we have ticked the ‘Visible’ box.

Help would be much appreciated.

Note: We’re using hotkeys (ctrl+alt+f5) to refresh data connections. There are known issues when using scripts like RPA to call macros to perform refreshes on external connections.

There are two options to introduce a delay before or after an Activity runs in UiPath: Delay After and Delay Before. You could use either of these options to set a delay for the excel to open and load and then perform any subsequent actions.
There could be better options to handle this issue for which others can comment.

Hello there,
Try element exist activity with appropriate selector and make use of boolean flag as condition and pass the sendhotkeys.

PS: for the better error handling you could use that in either while loop or retry scope activity.

That’s a good idea - I’ll give it a shot.

It’ll help with preventing the bot from crashing, though the bigger question of why the window doesn’t become ‘visible’ still unfortunately exists

I was having problems getting Send Hotkey to be consistent and reliable with Excel. I found that TypeInto is faster and more successful, atleast from my experience using it with Office Apps like Excel. But maybe it was just me :smiley:

For example, you can alternately perform ctrl+alt+f5 like this:
TypeInto “[d(ctrl)][d(alt)][(k(f5)][u(alt)][u(ctrl)]”

d for down press, u for up press, and k for key press

1 Like