loop command is skipped over

I have a task bot 1) that loops for each file in a folder 2) loop though each row in excel. All of a sudden it started skipping over the loop on line 28loop error. Anyone experiencing this issue?

5 replies

Userlevel 6
Badge +9

hi @Steven chev​,


After the fisrt loop(For each file in folder) and Before the second loop(for each row in work sheet), You need to open the worksheet, which is required with the same session name.


for your reference

image Hope this helps you


Happy Automation🙂

Sai Krishna

Userlevel 4
Badge +7

Hi @Steven chev​ ,


If you have included the Excel Open and Close Actions, then could you try adding a Message Box inside the outer loop to display the file it is currently iterating, and add another Message Box in the inner loop to see if it enters it?


Kind Regards,

Ashwin A.K

Hello @Sai krishna Somisetty​ and @Ashwin A.K​ 


I appreciate you both taking the time out to respond.

I have the excel file opened after I set the first loop (loop through each file in folder)

then I set the second loop (Loop through each row in worksheet) while also using the same session name. For some odd reason, the task bot will skip over line 31 and give me the notification stating the the task was successful. Any thoughts on this?


Also please let me know if additional information is required. Thank you!!


See below for command lines


Loop 1 - Loop through each file in folderLoop 2 - loop through each row in worksheet 



Hello @Ashwin A.K​ 

I have completed those steps and the message box for the first loop does display the file path and name perfectly fine. However, for the second outer loop it fails it display any information, rather it will pass over the outer loop (loop through each row in workbook) and specify the task has been completed. I should also mention that it does not loop through to the next file in the folder. It simply just says it was successful.


I ran a test where I created two different ask. the first that display a message box of the file path, works.


second task will display each row in one excel file and works fine as well.


The problem is when I stitch those two loops together in one task bot it fails. Any suggestions?

@Ashwin A.K​ @Sai krishna Somisetty​ 


I resolved the issues. I wasn't referencing my row records variables correctly. thank you for your responses