How to click on the VBA popup?



I want to automate the following process.

  1. Start Excel.
  2. Click the OK button on the popup.

*This Excel Book has the following code, and a message dialog is displayed at startup.

Private Sub Workbook_Open()
ActiveWindow.ScrollRow = 1
MsgBox "Test"
End Sub

So I started Excel with ExcelScope and coded to click OK But there is no reaction.
The method of sending Enter as a hot key, or use the StartProcess function, also did not work.

Since it’s not possible to modify the VBA side, please tell me how to control the VBA button with UiPath.

Thanks in advance.

Main.xlsx (9.2 KB)


Unable to close popup given by Macro
  1. Element exist
  2. if (true) then
  3. send hot key(enter)


Thank you for your reply.

Using the “Element Exist” function, if there is an object, I modified to send a hot key, but it still doesn’t work. Is there any other idea?
Main.xlsx (9.5 KB)

Thanks in advance.


Use Parallel Activity. On the one side execute macro, on the other click button.


Thank you for your reply,solved!
The solution was to place “ClickActivity” on the far left of “ParallelActivity” and “ExcelScope” on its right side.

Close Excel Macro Pop-Up Box

Oh my god, this did the trick, your a life saver!