Open file in folder if title contains certain text


I am looking for a way to perform actions on all excel files in a folder for which the filename contains the text “v1”.

Anyone to share ideas?



You can use Directory.GetFiles(FolderName, Pattern) to find the files in that folder that follow the given pattern.
Please check this sample to find .xlsx files containing “v1” in the name: (2.0 KB)

Hi @Mateus_Cruz,

Thanks a lot for the valuable input.
Looks great, but now I need to add an application scope for excel if I want to read cells/ranges.
The problem is that I then need to define a path to the excel file. I cannot do that as I want it for all the files.
How should I approach this?


Directory.GetFiles(FolderName, Pattern) will return file paths as strings, so you can just use that as input for the Excel Application Scope activity.