How can I solve this problem about sheet related?

Hello Community, @ Palaniyappan @ aksh1yadav
There are many Excel files inside a folder. At the end of these files
name robots that will open one by one. every file have 3 sheets. open one by one
files and I need to check sheet name like “newsheet” after checking for each file if
sheet name “newsheet” is exist then print I got it. If not get the sheet name in a file then that’s file will be delete.
Please solved the problem. It’s urgent for me.

1 Like

@Jesmine Use Directory.GetFiles(“Path of your directory to read Files”,"*xlsx") then Use a Excel application scope to read the Sheets using Get Sheets Activity then use one more for each loop to check if the name of the sheet equals “new sheet” then Print “I got it” else Delete the sheet inside the Excel application scope using delete sheet activity or append the sheet name to a Excel file to delete it manually.

Thanks @WhenCutEsh Sheet not delete, delete will be file, Sheet not available in which file. Thats file will be delete.
Please upload any code for sample.

@Jesmine

If Sheet is not available then use Delete File Activity to delete the file.

Thanks, @lakshman
Can you upload any code for that. It’s very urgent for me.please…

1 Like

@Jesmine

Could you please send me your workflow file and will check it and send to you.

1 Like

Thanks, @lakshman @ aksh1yadav @Palaniyappan
Please check my code.Send.zip (42.2 KB)
And give me solution. It’s very urgent for me.

Note: when first condition is(check with company.xlsx file list) match then should be open single excel file and check sheet name. if not available in sheet name in file then file will be deleted. continue this process one by one.

1 Like

here you go
hope its resolvd
deletefiles.zip (27.4 KB)
Kindly check with the Book3.xlsx file as it didn’t have sheet newsheet which will get deleted
And change the folder path as per yours in the GetFiles method

Cheers @Jesmine

@Palaniyappan please check my attachment and solve the issue please.Attachmentworkflow.zip (71.5 KB) has my code and flowchart. you just check sequence “send”. I want to use this in my code. suppose this is step1:
image

“Send” sequence is step2:
image

I need when step 1 satisfy then go to step 2(send)- here few excel file need to open one by one.It should be open single excel file and go to step 1. again satisfy the condition step1 then go to step 2. open another excel.