For each excel file that is open, save


I would like to open all the excel workbooks in a folder, and after that, once they’re all open, I want to save one by one. Once they’re all saved, I want to close one by one.

The question is: How can I loop through opened excel files? Because I’m using an start process activity inside a for each loop to open all of them, but how can I save them one by one?


Do you only need to copy the files? If this is the case you will not need to open the files; only copy them to a new destination.

No, I need to open all the files because, they’re connected. Once all the files are open, the values will update automatically. Then I need to save all of them and close them

If you use the Excel Application Scope, it will automatically open the file. If they need to be opened all at once, you’ll need to open application scopes within application scopes. If you can open them one at a time, you can save the file after opening within the application scope block.

From a programming standpoint, you’ll need a workflow file which can invoke itself for readability. Never tried this before, but I don’t see a reason why recursion wouldn’t work in UiPath.

I need to open them all before doing anything, and I don’t know exactly how many files I will need to open, because this will vary each week. That’s why I said that I need to loop through the opened files

Use Excel Application scope and then use save workbook activity.
it will actually save once it comes out from Excel Application scope you can see below
still you can use save workbook for surety

hi. try to use this solution.
ExcelWorker.xaml (8.5 KB)

1 Like

@Ivanco pretty slick. I was thinking the same thing. Adding the workbooks to a collection of type excel workbook was a nice touch.

Very interesting task