How to continue Excel loop, when processing was failing in between

consider u have 10000 records u started working on excel sheet suddenly it got closed due to some issue network or server and if u have completed some loops its comes to upto middle around 100 and u have to start from 101 how how will u identify its start??

@Pavan_P_J

You can write thw index of the loop to global variable or asset …and can read the asset and skip those number of rows before going to the for loop…or inside the forloop…

For skipping records…you can use…dt.AsEnumerable.Skip(number).CopyToDaTatable

Or inside loop use index and give condition as if index > number

Hope this helps

Cheers

Hi @Pavan_P_J

You can use the Try Catch Activity to continue the execution of For loop even if there is an error/exception during the execution of the loop . Just keep the body of for loop in in Try part of the Activity and in Catch section select exception and use log activity to navigate to the error reason for a particular datarow.

Regards
Ashvani Kumar

hi @Pavan_P_J
Can u try this idea

  1. Like put a Status column in the excel record to check whether a row of data has been processed or not

If it processed then put the status as complete or not put New there

So at beginning of workflow use filter datatable to filter out the datatable only having status as New only so that it process data only which are left as unprocessed

I am recommending here two states one is New and other is Complete which is to be put when Data has been processed correctly

Hope it helps you

Mark it as solution if you got it

Regards

Mohini :robot:

Happy Automation :relaxed::relaxed::relaxed::relaxed:

Another solution, similar to ones provided already, is to at the beginning of the process count lines which were already processed and use that value to set the excel range accordingly.