Loop through worksheet problem

Hello,

I’m using for each sh in wb.getsheets to loop through worksheets in a workbook. the loop works fine until I added a bunch of activities, then it no longer loops to the 2nd sh (execution stops after processing the first sh). I’m trying to figure out what caused the loop to break. can anyone please provide some general idea?

Hi @lynnsong986

Place all your code inside a Try block of the exception handling and log message on catch block.

Ex: “Occured error:”+exception.Message

This will help to identify where exactly the error is occurring. Thank you.

1 Like

everything is inside of a try catch, it doesn’t seem to have any error, it’s simple not looping through the sheets anymore

Hi @lynnsong986,

Inside for each put one try catch activity to get the exact issue why the sheet is not looping.
Try and let me know

Regards,
Arivu

Thank you both for your help. I figured out the problem, I placed an excel application scope inside an excel application scope, which breaks the loop.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.