Combine multiple Excel Files into a single file

I have multiple Excel files in a directory that are all formatted the same. I.E. They all share the same column structure and all only contain 1 sheet.

I would like to take the contents of each of those excel files and add them to a Target excel file in a different directory.

I have everything but the “Append” content part working. The contents of each of the Excel files are not getting written to the Target file…

Help?
Thx
Dean

Hello @dean.virag ,

Can you share your flow?

The steps are like this, in my opinion.

  1. Get all files from a folder.
  2. Use the Read Range to read the Target Excel - TargetExcelDT
  3. For each file use Read range (Workbook or Excel) - this will create a datatable - ExcelDT
  4. in the for each file, use also the Append datatable to the TargetExcelDT
  5. Write TargetExcelDT to the Target Excel file using Write Range

I hope it helps.

Vasile.

@dean.virag,

You can also use merge datatable activity instead of append.

or go with @wasea’s way

Cheers,
Pankaj

@dean.virag - please check this post …

Here instead of csv change it to .xlsx in the Directory.getfiles and use write range and append range in the if condition.

Hope this helps…

1: Use a for each file in folder activity to loop through files.
2: specify only “•.xlsx” ie file type cans also be “•.csv”
3: in the do attach application scope with name as CurrentFile.ToString
4:Inside it use copy sheet activity
5: specify sheet name to copy and destination excel file

Please mark as sln if works