Open one by one file from folder and save it and close

Hi currently i am using “for each” activity to open files from a folder all at the same time.

Now i need to open one file at a time save close, then open the next file from folder. is it possible anyway? any sample or solution would be a great help.


Hi @vignesh.maruthappan ,

Try using the for each file in folder activity, that would help you to iterate through each file one at a time in a local folder. You can set filters also if you want to open only xlsx or pdf or docx files.

Hope this method helps you.

Thanks,
Gautham.

it shows a eeor when i use for each file in a folder
image
image

Hi @vignesh.maruthappan,

As commented on the other post (Open files from a folder open by one using use application-click command - #3 by ignasi.peiris), drop a Use Application activity after the start process, with a dynamic selector to be able to attach to any open file on the list.

then do whatever actions you need to do, and end up with saving the file, either by clicking on the file, or however your file requests to be saved.

You can use the property “Close” - “Always” to close the file before the next one on the loop is opened.

BR,
Ignasi

Dear @vignesh.maruthappan ,

Start Process needs little tweak in configuration.
Please refer the sample flow.
ExcelTestProcess.zip (21.6 KB)
Hope this helps.!

Thanks,
Gautham.

1 Like

Also, this error is happening, as inside the For Each File in Folder activity, the variable “CurrentFile” is of type System.IO.FileInfo, while StartProcess accepts strings as input.

In order for this solution to work with a For Each File in Folder activity, you need to get the Full path as a string, with the following method:

Path.Combine(CurrentFile.Directory.ToString,CurrentFile.FullName)

BR,
Ignasi

2 Likes

thanks and great working

1 Like

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