Catch excel exceptions

Hi,

My process stuck in writing to excel file and if we didn’t realize it would be continue run forever. I connected to machine and saw this error.

After i clicked to “Ok” button process continued. I am using Excel App Scope is there any way to handle exceptions like this?
And why robot didn’t throw any exception like “…being used by another process…” ?

Edit: Actually robot send exception after i clicked “Ok” button.
Exception is: “Message: Could not write the data table DataTable starting with cell A1. Source: UiPath.Excel.Activities”.
But if i wouldn’t click process would be “in running” all these time.

Thanks

@mserdar

You can use Kill Process before Excel Application scope

Hope this may help you

Thanks

The file in an shared folder. Probably i will face this problem again but if i can catch exception i can use Retry Scope or something else.

Hi @mserdar ,

Best approach to handle this is when bot run started you should trigger one mail to respective process owner or SME as "process is started please do not open file till you receive bot completion mail.

If you can inspect this popup better to put it in parallel activity.

Hi @ermanoj3101

As i understand there isn’t any configuration for excel or excel app scope activity to handle exceptions like these and probably there wouldn’t be any difference if i used workbook activities.

Excel Application scope works if you are reading already opened excel.
What exactly you are using workbook or excel activities ?

I am using delete, write, read range activities in excel app scope and normally they works. Probably i got this error on write range activity while someone using the excel.

It seems like robot opened the excel successfully but could not edit.

And i forget the say actually robot send exception after i clicked “Ok” button.
Exception is: “Message: Could not write the data table DataTable starting with cell A1. Source: UiPath.Excel.Activities”.
But if i wouldn’t click process would be “in running” all these time.

I have also faced similar issue in past but it’s not easy to tackle this.
There is one more approach to do this but i have not implemented it as my client agreed to notify them when bot start it’s run.

Other Approach - You can create copy of the file from share drive and just read and write on that file and in the end just copy and replace that file to share drive.
You can also use Macro code which even works when file is open somewhere i need to check that Asynchronous code

1 Like

Yes, in this case for me best approach looks like copy the file while in process. I wondered whether it is or not any solution for if excel throw exceptions like this in future that we didn’t recognize.

For these situations seems like only option are paralel timeout or orchestrator feature that kill process after xx hours.

1 Like