Can you exclude a sheet from a "For Each Excel Sheet" activity

Hi. I am new at this. I am wanting to run a “For Each Excel Sheet” activity, but I need to Exclude 3 Sheets from loop. I have tried doing this by inserting an “IF” activity to see if the sheet name is one of my exclusions and to skip the tasks. This doesn’t seem to be working, as the For Each is still processing each of the sheets. (I have a write line activity outputting the sheet names as they are processed.) I have tried both the “AND” and “OR” options in the If statement but to no avail.

Below are screen shots of my Activities.
“For Each Excel Sheet” activity with “If” statement

2020-09-24_14-56-41

Here is the Condition Builder with the 3 Sheets I wish to exclude. (i have tried variations of “And”/ “Or” and also with and without speech marks around the sheet names.)

2020-09-24_14-56-06-7

Not sure what I am doing wrong. Thanks for any assistance you may be able to provide. I have search the community but cant seem to find a similar question / solution.

Thanks

Murray

You actually don’t need the double quotes when specifying the sheet names, this is why the IF condition is not working. Make sure to insert the exact sheet name in the Text Builder window:

As an alternative you can use OR between IF conditions combined with the Skip Current activity:

image

1 Like

Thanks will try the skip current approach. I had tried with and without the double quotes, and had copied the sheets names to ensure they were spelt correctly.

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