How to know where the process stops in a download tool and write a status on excel whether completed or not

I have a tool that downloads report from an application. Each report being downloaded is based on the records on an excel file. I have a For Each activity that loop through each record to download the report per ID. Now I would like to know on which record on the excel file the process stops in case there is an error or the tool just automatically closed and put a status on its corresponding record on the excel if report is completed or not.

Here’s what I only know so far:

  1. I need to use write range activity for the status but I don’t know how to use it on my for each activity
  2. I need to know which record the tool stops or has an error downloading but I don’t know how or what activity to use

Need advise, ideas or references on how to implement it. Your help will be greatly appreciated. Thanks!


  1. Add one extra column named Status to your input excel file.

  2. Process one by one record and update status as Successful if file downloaded successfully else update it as Failed. You need to handle exceptions properly for failed cased.

Note: Use REFramework Template here if you are not using it.

1 Like

Hi @elizmarie,

After reading the excel in a datatable say DTBook using Read Range activity, use an Add data Column activity and add a Status column in your DTBook then enclose the whole loop or your section in a try catch, while looping at the end of loop if everything is good write the status as Success else in case of exception BOT will go to catch block in that block update the status of that item as Failed.


1 Like

Hi @Shikhar_Tandon , thanks for the idea. I’m already catching a failed case but I can only log it in a message box… when I try to use write cell to write the “Failed” status on that particular record it’s giving me an error saying “The given key was not present in the dictionary” and when I checked the excel file, the “Failed” text is not on the right cell and the data are all mixed up. I’m not sure where did I go wrong. I also placed the add data column below my filter data table activity then after that is the for each where I loop every single record I filtered then I surrounded the body of my for each with the try catch.

It will be nice also if you have a simple demo where I can follow the flow. Thankss

Can you share your xaml? so that i can correct it

Sample.xaml (15.9 KB)

I’m afraid I won’t be able to share it because it’s an internal project but I created a sample xaml file with the same flow I have in my project.

Updated the file just now.