How to merge different excel files into single excel file

how to merge 21 excel files into single file as 21 sheets
how to do that
there are 21 excel files, the excel files should merge as single file with 21 excel sheets

@anjani_priya

You can use copy paste range activity

with two use excels one the main excel and second inside for loop for each excel


Or you can use workbook read range and then use write range workbook to write to final excel in loop

Both works

cheers

2 Likes

@anjani_priya

Directory.getfiles("Folderpath")

use for each for array and create output for each activity

inside use read range activity for reading the excel file

below that use write range activity and make the sheet dynamic by passing the for each output

can you send the sample code

there are 21 excel files how to keep the loop

@anjani_priya

Please check the screenshot above

cheers

how to mention the source?


these are the excel files i have

@anjani_priya

in the source just you need to need the sheet name

and in the destination you need to make it dynamic by passing the int32 variable

can you explain how to mention the source and destination because i have different names for every excel file and sheet

@anjani_priya

Mutiplefilestosinlgefile.zip (13.4 KB)

hope this helps

i have developed the code in 2 ways

one is creating with the sheet names as Sheet1 ,

other one creating the sheetname as 2040001,

@anjani_priya

Surce will be excel1.CurrentSheet

and destination is Excel.Sheet("Sheetname" + currentItem.ToString)

cheers

I think you have send reversely
source contains 21 excel files
in your screenshot use excel file activity can only takes one excel file?
how to do

@anjani_priya

Excel is the handle for use excel check the screenshot

cheers


error

what about excel1? the error is that excel1 is not intialiazed

@anjani_priya

Excel reference should be mentioned as excel and excel1

cheers

the destination sheet came empty

@anjani_priya

Can you please show screenshot of what you have done

Cheers




these are file names