Constantly log data after iteration

I have a process that corrects simple error codes. There are hundreds of error codes and when submitted they are no longer in the system, and there is no history of the corrected errors.

For my purpose, I just need to log in a spreadsheet how many errors were completed by the robot. My problem is how do I deal with this in the event my program crashes, we are using a third party website so this is possible. Do I write to an excel workbook after each iteration? I am worried that opening excel so many times will cause problems - would the system write range be a better option? Any other ideas?

If you are worried about opening excel each time, you can keep it open till end of the operation. Other option is use logs.


Keep the excel open till the end and close at the end of the operation.
Use Try/Catch/Finally blocks. In case of program crash, In the catch block, save the excel file and close.

Karthik Byggari


Hi @mkkajtez - You can create a datatable with the required columns and whenever there is an issue, capture it and save it in the datatable. Later you can use write range to save the file.