Loop through multiple excel files

How can I run a workflow as a loop on multiple excel files in the same folder? (currently it is only running on one excel workbook)


Welcome to our uipath community.

  1. Try below expression to get all excel files from particular folder.

     arrExcelFiles = Directory.GetFiles("FolderPath","*.xlsx") 
  2. And then use For Each loop to iterate one by one file.

           ForEach item in arrExcelFiles
                - Use Excel Application Scope activity and pass item to it.

Hey man. I’m pretty new to UiPath. I understand I need to type the first part in the “Assign” activity, but I have no clue how/where to. Can you send me a screenshot or provide further instructions how I can do that? Really appreciate it!

1 Like


Use Assign activity and on left hand side write arrExcelFiles and on right hand side write remaining expression after equal sign.

Here arrExcelFiles variable is of type Array of string.

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