How to read all excel in one folder

Hi,

Can anyone give me an idea.

How to make robot read all excel at once in one folder instead of reading excel one by one?

1 Like

@mashy2

Follow these steps:

  1. String excelFiles [ ] = Directory.GetFiles(“folderPath”,"*.xlsx")

  2. Above expression will read all Excel files from folder and will give output as String array.

  3. Then use For Each loop Activity to itreate that array of files and use Read Range Activity to read Excel data and use this Activity inside Excel Application Scope Activity.

2 Likes

Thanks Lakshman,

what if i want to merge it into data table once it read all excel?

1 Like

@mashy2

Inside Excel Application Scope you are using Read Range Activity right to read data from Excel and pass that output dataTable to Append Range Activity to append data. Then it will read one by one Excel file data will append it to existing data using Append Range Activity.

2 Likes

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