How to read all excel files in a folder

Hi all,
I have some excel files in a folder and i have to read one by one excel file. I contain some values in those files, and i have to enter those values in browser. Please help me out. Thanks You


Hi @mrupendrareddy123 ,

Use for each file in folder.
You can filter by *.xlsx if there are files other than Excel.

1 Like

Hi @mrupendrareddy123 ,

First, we need to fetch all the file names of all the Excel files in the folder. You can do this by using an Assign activity. So we passed the collection into an array of String variable.

StringArrayVariable = Directory.GetFiles(“location”,“*.xlsx”)

Then, we can now loop into our variable by using the For Each activity and add the Excel activities inside the loop.

I hope this helps. Happy automation!

Kind regards,

1 Like

Hi @mrupendrareddy123

str= directory.GetFiles("Your path")

foreach file in str

path.GetExtension(file).Equals(".xlsx") or path.GetExtension(file).Equals(".xls")

if condition

path.GetExtension(file).Equals(".xlsx") or path.GetExtension(file).Equals(".xls")

Use Read Range Workbook to read the file.


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