Excel has stopped working - error handling

I have a job that scheduled to run for every hour, it is working smoothly but there will have chance that below “Microsoft excel has stopped working” error message will be appeared.
This will made my RPA keep running since i have a while checking for next step, is there anyway to:

  1. detect this kind of error message?
  2. detect if my job is running for more that a hour (Due to the error message in 1) then let Uipath to click the “Close the program” button, and restart whole process?
    (Note that i already have a try catch to catch all the exception, for exception it will send an email alert to me)


You can use in try catch if ui path throws exception or you can have parallel activity to click on the close application if the error pops up.

Let us know if this helps.
Pavan H


I already use try catch with exception for the main flow, I am not sure how can I precisely catch this excel error , and at the same time to have a try catch exception to catch all other unexpected error.

As I have a while loop to check if next step is ready, it will just keep looping till it find the next selector (i need this for my flow)

However, if the Excel error message appeared, is like it will prevent uipath to read the next step selector( even though the next step selector appeared) .
Until I click the " close the program", then it will resume next step selector, or else it will just keep looping the while loop.

Can you try to figure out where exactly you are getting this pop up and have element exists there, if yes click close application and Continue with your next set of activities?

I think that’s excel or system issue?
Sometimes it appears twice in a day, sometimes once per month, totally random.
And it does not have a specific place to happen it my workflow, just randomly appear in between the whole flow

@Haha I am running into same situation. Were you able to resolve it? If so, would you please be kind to share with us. It would be a great help. Thanks in advance.

I have an idea by using parallel.
Left hand side create a boolean called processfinish, default value is false, once your left hand side flow is finished, set it to true.

Right hand side is a do while loop with condition processfinish= false as condition. (with 5 mins delay), it will check whether the pop up exists, if yes, it will close the pop up.

For pararell condition, set it to processfinish = true

Hello guys encountering the same error and wanna use the element exist but the error isnt coming up anymore any idea how to reproduce the error so i can element exist it?

I would suggest to identify the root cause of the problem, instead of working out in uipath.
It’s excel app related issue, I was facing the same, what i did was, I removed additional addins which were no longer in use. and reinstalled excel application.
this fixed the excel problem.

Check also extension which you are using.

Hope this helps.

This idea working fine for you?
i’m also facing the same problem so please share the solution what u did for this problem.

Thank u…

Hello Tonkyun,

I am going through the same error but I don’t know how to solve it. But I have the instance of the error with me. It may help you. PFA.
Excel Error.xaml (5.7 KB)

Yes you are right, I have the same issue and I guess “Try Catch” will not find this Excel error popup.
And in my case I run a macro and sometimes I face this error. And the best part is I know where exactly I get this error and also I have saved the instance of it. But I don’t know exactly how to make the click when it appears randomly while running the macro? Can anyone help me in this?

And also I am trying with parallel activity along with the Macro I run. But I am not sure this will work…!