Save multiple excels into one excel

Hi Team,

I am using aspose.cells and i have to save multiple excel files into one excel file so that i can convert it into a consolidated PDF.

Could you please let me know how can i concatenate multiple excel files into one consolidated excel.

@dewan.ishi,

Thanks for your query.

Well, you may use number of ways to add/merge different sheets of workbooks into on file. You may try to browse different sheets of a workbook (you may try some loop) and copy them to other workbook using Worksheet.Copy() method, see the document for reference: Copying and Moving Worksheets|Documentation

Alternatively you can use Workbook.Copy or Workbook.Combine methods if it fits your need, see the following document for your reference:

e.g
Sample code:

 var workbook = new Workbook("e:\\test2\\test.xlsx");
            var workbook2 = new Workbook("e:\\test2\\test2.xlsx");
            workbook2.Combine(workbook);

Hope, this helps a bit.