Need sequence to start running at specific worksheet index number and loop until the last worksheet

Hi UiPath gang

I just started using UiPath for work and I’m trying learn how to loop a specific sequence I created. To give a little background, I’m just trying to have UiPath open an excel workbook (with an excel add-in tool created by our bank) and have it click an update button to update bank balances. But I want the sequence to start at a specific worksheet and loop until the last worksheet. I really don’t know the best way to go about it but I figured it would require the use of send hotkey to flip through the worksheets. Attached is the sequence I created, if someone has any tip/suggestion/feedback I’d greatly appreciate it.

@TA_treasury - Please try this…

In the Excel app scope I have declared a workbook variable called wb

For Each - Arguement type is ‘String’ and “Values” is Wb.getsheets → this will get all the sheets in the workbook…

In my workbook I have 4 sheets, I would like to start from 202101 till the end…

image

So I am setting the flag and using that flag to find my starting sheet.

My Output-- You can add your process in the “Then” loop as per your requirement.

image

Hope this helps…

Thanks for responding. I played around and it appears to be working so thank you! However it seems to have stopped before getting to the last worksheet. The sequence updated 42 out of 50 worksheets. Do you know how I can trouble shoot this?

Hi @TA_treasury … Do you have any constant index to start with? Say in every sheet you would like to start from 3rd sheet ?

I have 3 files I’m trying to update 2 of them start on the 3rd sheet and 1 starts on the 12th sheet. My plan was probably create either 2 or 3 different projects if necessary.

We can use index component to check the count of sheet we are reading…

But you said , in two workbooks you would like to start on 3rd sheet and third work from 12th.so you would need their names to check the condition…Say.

If(Workbook Name.contains(“XXX”) and Index =3 ) or (Workbook Name.contains(“XXX”) and Index =12) …something like this…