How to read specific data from a excel file which is placed in a folder and folder contains 30 excel files


I want to read the data from excel files which is placed in a folder(the folder contains 30 excel files),
here i want to check the data in each excel file by using date or some id(if any of the excel file contains the data related to what i have searched is to be written into another excel file).


You need to use Directory.GetFiles(“FolderPath”,“File Extension”), this will give you an array then you can apply for each loop on it and perform operations on each file



It will ask for sheet name of excel file,is it possible to read excel file without sheet name.


Its not possible to read the excel without sheet name. You can get the sheet name by creating Workbook variable in Excel Application Scope


Can u please give me the sample workflow for it.


Here it is -

Main.xaml (8.0 KB)
Sample.xlsx (8.8 KB)

this will give you sheet name then you can use Read Range with this


That works,but for me i have excel workbooks in a folder(30 excel books) and 30 excel workbooks have different sheets with different names,now i have to read specific data from excel workbooks(such as based on date or id’s) for this i have to check each workbook in the folder with sheet name.
How can i get this,can u please help on it.


Here is the example which would pick each excel file in the folder path given and for each excel file operations can be performed by Excel Application Scope

Main.xaml (10.2 KB)

Excel (30.6 KB)


Is it possible to read the data in excel files in your folder instead of reading sheet name.


We read the sheet name because the sheet names for so many files can not be known. yes you can read the data by using Read Range activity in same workflow


ok,in the reading excel file if the repeated values are coming,it is showing an error

“A column named (some value) is already belongs to this data table.”
Is there any solution for it.


Column names should be distinct. For removing duplicates you can use Remove Duplicate Rows activity


Actually in my files there is no column names


I have the excel files like this.New folder (5).zip (28.7 KB)
and my uipath workflow flow fileMain (4).xaml (11.3 KB)
In the output it is printing empty spaces after printing the file name.
Can u please correct it,if there is any errors.


you want to read ex1.xlsx to ex5.xlsx right? and After reading?


Yes,It is the sample files.
But in my original data there is no column names for it.


what do you want to do after reading files?


I have to write each file into an excel file with some column headers(A1,A2,A3,A4)like that.


You would have to something like this to achieve what you want -

Main.xaml (15.0 KB)


But in read range activity,i don’t want to specify sheet name,
is it possible to read data without specifying sheet name.
And also i have to write each excel file data into the separate excel file.(i don’t want it to be in single excel file).