Get only .xls from folder


I have a folder that has .xls and .xlsx. I am using assign then excel application scope but only want to run the workflow with .xls. How can I do this? thanks

—use a assign activity like this
arr_filepath = Directory.GetFiles(“yourfolderpath”.””*.xlsx“)
Where arr_file path is a variable of type array of string
—this array will contain both xls and xlsx file
—now use a FOR EACH activity and pass the above arr_filepath variable as input and change the type argument as string in the property panel
—inside the loop use a IF condition like this
NOT item.ToString.Contains(“xlsx”)
If this condition is true it will go to THEN part where we will be getting only xls files which can be process with EXCEL APPLICATION SCOPE
goes to ELSE part where we can leave it empty

Cheers @sparkplug93

1 Like

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