System Exception : Read CSV


I randomly get the below mentioned error during execution,
Sometimes this happens after 5 successful transactions.
I fail to understand how to get this fixed.Since no one access these files during execution.
What do they actually mean?

System exception. Retry: 0. The process cannot access the file ‘C:\Users\vidya_srinivasan\Documents\UiPath\GenerateYearlyReport_Walkthrough_Performer\Data\Temp\Report- DE763212-2018-January.csv’ because it is being used by another process. at Source: Invoke System1_CreateYearlyReport workflow: Read CSV

Attaching my XAML
(upload://s6tppGp78JknuCSRW2wQzaP3gTi.xaml) (29.5 KB)

Thank you very much in advance for your time to look into this.
This is how i avoided overlap between creation of file and reading.

I hope you are trying to reopen the excel several times @Vidya_Srinivasan

So, before opening excel , try kill process activity to kill the excel.exe process and then open that excel. It will do the trick

1 Like

Hi @Vidya_Srinivasan

Was just about to say the same thing @HareeshMR mentioned… :grinning:

1 Like

We used to do that oftenly everytime @Lahiru.Fernando , posting the same answer with a small time gap :wink:

1 Like

How to ensure we are trying to reopen the excel several times?
Does my while loop suffice for that ? Because we keep trying until it opens.

So where would you like me to try and keep kill process ?
Will it do before the while loop?Or i need to place it elsewhere?

Lastly how will kill process help me this?Just trying to understand the logic :slight_smile:

1 Like

Actually, if we try to open the excel multiple times, the process will be closed in the front I mean on screen., but it will be in the running state when we open task manager. So, the process will give you the error as above. Instead of that, I suggested that, before opening the excel or CSV, if we clear all the running background processes, then it is clear and we can open the file without any error @Vidya_Srinivasan

Before read CSV, use Kill Process and give the input as excel.exe :slight_smile:


Excellent.Thank u so much.Will let you know if i was able to avoid this issue.

1 Like

Happens :slight_smile: however thank u so much !

1 Like

The one i last posted was the last error i was seeing.But now a new error came up.
I feel its more of some sync issue.Because i have ran numerous times and this issue never came up.

Click save: Cannot find the UI element corresponding to this selector: <wnd app='iexplore.exe' cls='IEFrame' title='ACME System 1 - Reports - Download Monthly Report - Internet Exp*' /><wnd aaname='Notification' cls='DirectUIHWND' /><ctrl automationid='IENotificationBar' /><ctrl name='Save' role='split button' /><ctrl name='6' role='drop down button' />

However when i run step by step,the same selector identifies the save button for the same month which showed issue.Please let me know if i should attach my XAML file for create yearly report.

Thank you.

This is just because the workflow doesn’t recognize the selector @Vidya_Srinivasan … Make sure you have the page opened in the background so that Studio will recognize the node without any issue.

actually i had 10 work items for processing.
This happened for 1st work item.And then i reran the other 9 without any change.
All 9 ran without a single issue.

And it doesnt seem like selector issue because it ran in debug mode and even other 9 transactions ran without issues.

Let me run them again.Il update you in case of any issues.

Yeah, @Vidya_Srinivasan

Please try running them again and check if that particular case which fails is having some issue with the page opening or any other :slight_smile:

Sure will do now.

Ran again.This time the old error came again :frowning:

I am clueless on what else i need to do.

Just to have some coding standards,

use kill process in a TRY Catch block @Vidya_Srinivasan and a small delay after the Kill process activity .

Are you sure your browser is opening the page before the error pops up?

I am not sure about that.

Yeah, the studio will recognize the selector when the browser is open @Vidya_Srinivasan

If you open the selector and click on validate, it will show error if the browser is closed in the background. Whenever the browser is opened in the back, then only it will validate the selector. Try this also :slight_smile:

Can you please elaborate on what i need to keep in Try and what in Catch.
I am not very familiar with try catch in this scenario.
Are you expecting something of this kind?

I am expected to give something in catch or finally.

Appreciate your help.

Just click on catch and you will have drop down there. select the system error. and if you want to do anything there, then use the activity @Vidya_Srinivasan

is this fine?