How to Dismiss Excel Find And Replace Result Message Box

emphasized text
Hello all,

What I’m achieving:

  1. Open any Excel file
  2. Ctrl - H (Find and Replace)
  3. Find any available character, Replace All
  4. Dismiss the message box “xx words are found and replaced” (click OK button)

The problem:
After clicking Replace All button, I cannot click the OK button. It’s not the click failed or timeouted, but it is never executed. It seems like UiPath is waiting for the message box to be dismissed so Excel can be available, while Excel waits for the message box to be dismissed, so (by UiPath or human) to be available it’s kinda waiting for each other.

Does anybody know how to resolve this?

The message box (it is in Japanese, but it is the message box of Replace All results).

The capture of code: (in this case, the Message Box “Hello” never showed up)

And the code itself:
test.xlsx (7.8 KB)
Test.xaml (11.4 KB)

Hi @whyyouandi
You Can use Excel application scope and do the manipulations


Hello @AshwinS2, thank you for your reply.
I tried too using Excel Application Scope but it has the same result.
The actions after won’t be executed unless the message box is dismissed.
And the action to dimiss the message box is located after the replace.

hi @whyyouandi

Can you show me the selector for OK Button

Ashwin S

@whyyouandi Instead of using message box you can use call out actvity

Hello @whyyouandi,

Please use attachment.
test.xaml (9.9 KB)
test.xlsx (8.1 KB)



Hello @AshwinS2, the selector was not the problem. Even when I tried with another activity, it just won’t go there.

Hoopps. Seems I explain my question badly.
I don’t think it will have any change in changing my Message Box to Call Out (it is just example anyway).
But thank you for your idea :slight_smile:

It is working @Pankaj.Patil , thank you!
If it’s fine with you, could you kindly explain why it wasn’t working?

Using your code as reference, I stopped using both Excel Application Scope or Attach Window, but can’t get a grasp what was wrong.

Hello @whyyouandi,

at me, when my bot was clicking on button Replace All. sometimes dialog box was coming and sometimes not. I also tried both attach browser and excel application scope. but no luck.
I found this beautiful way.


Sorry for the late reply. Thank you @Pankaj.Patil :slight_smile:

Here is a custom activity to find and replace text inside the wroksheet.


1 Like

Hello @balupad14, thank you always for your contribution!
Will check it later!

1 Like