When using Range.Copy the comment of the cell from the next row is deleted.
To reproduce the issue please use the attached Excel files and the following code:
var workBook = new Workbook(“CopyToDocument.xlsx”);
var rangeName = workBook.Worksheets.Names.First(n => n.Text == “DataPoint_38485”);
var range = rangeName.GetRanges();
var newWorkbook = new Workbook(“CopyFromDocument.xlsx”);
var newrangeName = newWorkbook.Worksheets.Names.First(n => n.Text == “DataPoint_78015”);
var newrange = newrangeName.GetRanges();
range.Copy(newrange, new PasteOptions
PasteType = PasteType.All,
SkipBlanks = false,
Transpose = false
When opening TestResult.xlsx you’ll see the comment of the cell E10 disappeared, that cell
was not involved in the range copy process.
Thanks for your posting and using Aspose.Cells.
We were able to observe this issue after executing your sample code with your provided Excel files using the latest version: Aspose.Cells
for .NET v220.127.116.11. Comment of E10 got deleted by Range.Copy() method in the output Excel file.
We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.
This issue has been logged as
- CELLSNET-43188 - Range.Copy is deleting the comment of the cell from the next row
I have attached the output Excel file and screenshot for a reference.
Thanks for your using Aspose.Cells.
Please download and try the latest fix: Aspose.Cells for .NET v18.104.22.168 and let us know your feedback.