Example: Location:C:\Users\Downloads
Test.Xlsx
Test2.xlsx
Test3.xlsx
Export to excel.xlsx
I need to delete the Excel files except “Export to Excel” this file
Hi @SND0912
You can use the below code in Invoke Code:
Directory.GetFiles(folderPath, "*.xlsx").
Where(Function(file) Not Path.GetFileName(file).Equals("Export to excel.xlsx", StringComparison.OrdinalIgnoreCase)).
ToList().ForEach(Sub(file) IO.File.Delete(file))
Invoked Code Arguments:
Regards