How to keep the specified sheet in excel?

Hi,

I have excel with multiple sheets which will be in specified name.
I have to keep only specified 2 name sheet in the same excel file.

Can someone guide me on this?
Thanks

@jamuna_T
check this reference

try this flows steps:
Excel Application Scope (Path: “your_file_path.xlsx”)
Get Workbook Sheets (Output: sheetNames)
Assign: sheetsToKeep = New List(Of String) From {“Sheet1”, “Sheet2”}
For Each (item in sheetNames)
If: Not sheetsToKeep.Contains(item)
Then: Delete Sheet (SheetName: item)
End

1 Like

Hi @jamuna_T

Can you try like below

CurrentSheet.Name.Equals("Sheet1") Or CurrentSheet.Name.Equals("Sheet2")

Sequence15.xaml (18.4 KB)

Regards,

1 Like

Thanks for the response , could you please provide this as a Xaml

Please find attached xaml . Hope this helps. Also kindly mark Resolved if it resolves your query. Thanks !!
Main 1.xaml (13.7 KB)

1 Like

Thanks for the response, When i am trying this getting error like
Delete Sheet: Unable to get the Delete property of the Worksheet class
please assist me on this

@jamuna_T

Have you tried this?

Regards,

1 Like

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