concatenating multiple workbooks

Technical support for Spire.XLS

Moderators: iceblue support, Flash, Manager

concatenating multiple workbooks

Postby rose » 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

Re: concatenating multiple workbooks

Postby iceblue support » 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: 244
Joined: Tue Dec 21, 2010 2:56 am


Return to Spire.XLS

Who is online

Users browsing this forum: No registered users and 0 guests