We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Copying worksheets does not copy ranges correctly


When I tried to copy a worksheet with a range defined* to another workbook the range was not copied correctly.
This is because when I do the copy action only the namedranges from that worksheet is copied to the collection which I can read with objWorkbook.Worksheets.getNamedRanges(), while the ranges from the other pages are copied to the objWorkbook.Worksheets.Names collection.

So when I do the following:
Open Workbook: Names.Count = 7, getNamedRanges.Length = 7
Copy worksheet from workbook with only one sheet: Names.Count = 8, getNamedRanges.Length = 8
Copy worksheet from workbook with multiple sheets and ranges: Names.Count = 19, getNamesRanges.Length = 9
Copy another worksheet from this workbook: Names.Count = 19, getNamesRanges.Length = 9

*My source workbook contained:
3 worksheets, first sheet contained 2 namedranges, second also contained 2 namedranges and the third contained 1 namedrange. None of the namedranges has the same name.

My target workbook contained:
Multiple worksheets with multiple namedranges, except for the worksheets which are targeted to be overwritten by the copied worksheets.

Could you please tell me what I do wrong, or fix it if this is a correct bug :)?

My Aspose.Cells version is for .Net and is version


Thanks for considering Aspose.

Could you post your template files with sample code to show the issue. We will check it soon.

Thank you.