Free Support Forum - aspose.com

Merging Sheets of several Workbooks into a given Workbook

Hi,

quick question: I need to take a couple of sheets from several different Workbooks and merge these sheets at defined locations into another Workbook. The target indices / locations within the target workbook are determined by placeholder Worksheets with the name names as the ones found in the other Workbooks.

Example

Workbook1.xls contains Sheet 1 and Sheet 2
Workbook2.xls contains Sheet 4

These are being generated / populated by my application. Now I have a Workbook3.xls that contains (empty) sheets (in that order) Sheet 1, Sheet 4, Sheet 2. I need to take the sheets from the other two Workbooks and place them in Workbook3.xls at the locations identified by the placeholder sheets.

What would be the best way to accomplish this? Is there any way I could do this?

Excel.Combine()? But how would I move my sheets around? Setting the Worksheet.Index? Using AddCopy() and then deleting the original sheet?

Any suggestions / help would be highly appreciated

Thanks in advance

Regards

Kai

Laurence,

never mind, found it. Worksheet.Copy() does the trick (mostly). Please see my other / private post regarding an issue I have with merging the sheets.

Regards

Kai