@Tracy1
Please follow the below approach:

Code:
Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: $'''C:\\Users\\Downloads\\EmpDetails_Sheet1.xlsx''' Visible: True ReadOnly: False Instance=> ExcelInstance
Excel.GetAllWorksheets Instance: ExcelInstance Worksheets=> SheetNames
Display.ShowMessageDialog.ShowMessage Title: $'''Info''' Message: SheetNames Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed
LOOP FOREACH CurrentItem IN SheetNames
IF NotContains(CurrentItem, $'''Success''', True) THEN
Excel.DeleteWorksheet.DeleteWorksheetByName Instance: ExcelInstance Name: CurrentItem
END
END
Excel.CloseExcel.CloseAndSave Instance: ExcelInstance
Thanks,
Deenuji Loganathan 👩💻
Automation Evangelist 🤖
Follow me on LinkedIn 👥
-------------------------------------------------------------------------------------------------------------
If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀