Hello,
I’ve been getting corrupt workbooks after trying to use Range.Copy with PasteType.All after a Range.CopyData for some specific content.
I’ve attached the two workbooks and sample code that reproduces the issue:
Aspose.Cells.Workbook Source = new Workbook("C:\\_Test\\Source.xlsx");
Aspose.Cells.Workbook Destination = new Workbook("C:\\_Test\\Destination.xlsx");
Aspose.Cells.Range sourceRange = Source.Worksheets.GetRangeByName("Range1");
Aspose.Cells.Worksheet targetSheet = Destination.Worksheets[0];
Aspose.Cells.Range destinationRange = targetSheet.Cells.CreateRange(3, 25, sourceRange.RowCount, sourceRange.ColumnCount);
destinationRange.CopyData(sourceRange);
destinationRange.Copy(sourceRange, new PasteOptions { SkipBlanks = false, PasteType = PasteType.All });
Destination.Save("C:\\_Test\\Result.xlsx");
Test.zip (23.0 KB)