Try Catch Runtime execution error handling

Hey,

I’m getting a runtime execution error when trying ot open an excel file(A problem with the file). And am trying to handle this with the try-catch activity but it is not picking it up only stopping the proccess when the error comes up. Ive selected the exception type “System.Exception” But for some reason the process is ending instead of running the catch process. Any idea’s of how i can catch this error?

Runtime%20error

Hi @emmet,

You can Try the following :

  1. Retry By killing all the excel Instances from Task Manager.
  2. Use WorkBook Activities instead of Excel Application Scope.
  3. The Sheet You are trying to Read has a lot of Rows … Clear the extra Rows from the Bottom of excel (Ctrl + shift + end) - then delete - This will clear the extra rows which may have some unnecessaryformula/data and then retry.
  4. If possible please share the excel.


Mukesh

Hi
Before excel application scope use a KILL PROCESS activity and mention the ProcessName property with value as ”EXCEL”
then use Excel application scope

And kindly ensure that we are not running in debug mode
Because Try catch block will actually take in the exception and won’t stop the process

Kindly try this and let know for any queries or clarification
Cheers @emmet

Thanks for your response unfortunately none these suggestions worked.

I’m trying to get Uipath to catch the error not fix the issue with my workbook.
The sheet I’m reading does have a lot of rows but I cannot delete any of them as it is also use by another system, why cant Uipath read the whole sheet?

Hi, thanks for your help

Unfortunately your suggestions didn’t help. Uipath does not catch the error in Debug or normal “Run” mode, the process is always killed.

hmm…no buddy
because only when ran on Debug mode the catch wont work and stops the process when any exception occurs…
but when ran in normal mode it would surely catch the exception
Cheers @emmet

Well it’s not catching it, do you think the exception type I’ve chosen is incorrect? the one I used is System.Exception. Also I’ve had errors caught in debug mode, so saying that the catch wont work in debug mode is false.

Can you share the Excel file ?

I cannot, it contains sensitive data.

Hi Guys,

So fairly sure the issue was due to running out of Memory, I got around this by using the “kill process” activity as well as ensuring other programs were not using up my memory. However this is still not explaining why Uipath is unable to catch the error.