Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Fri Dec 24, 2010 1:47 am

Hello,
I am a user of the Spire .XLS. And I am interested in the Spire .XLS when I use it.
Now I have a question about it. That is whether I can concatenate multiple workbooks in C# using Spire .XLS.
Can you show me any method?

thanks

rose
 
Posts: 3
Joined: Tue Dec 21, 2010 8:29 am

Fri Dec 24, 2010 7:48 am

If you want to do so, you can follow the codes below:
//Creating source workbook
Workbook workbook = new Workbook();
//Load workbook from disk.
workbook.LoadFromXml(@"..\..\test1.xls");

//Creating destination workbook
Workbook workbookDest = new Workbook();
//Load workbook from disk.
workbookDest.LoadFromXml(@"..\..\test2.xls");

//Copy worksheets from source to destination
workbookDest.Worksheets.AddCopy(workbook.Worksheets);

//Save workbook to disk file.
workbookDest.SaveToFile("Sample.xlsx",ExcelVersion.Version2007);

//View excel file.
ExcelDocViewer(workbookDest.FileName);
e-iceblue support
User avatar

iceblue support
 
Posts: 240
Joined: Tue Dec 21, 2010 2:56 am

Return to Spire.XLS

cron