Copy a Range with Paste Options PasteType.ALL not copying row heights properly


While copying a Range from one sheet to other, I am facing problems with Row heights. Also, any images/icons with in the copied range are also loosing their size properties.

I am using Aspose.cells for java “aspose-cells-18.4” and trying to copy a range from one sheet to another with PasteOptions All.

The results is some what inconsistent especially with row heights. However, column widths, values formatting all looks fine.

Hidden rows are being set with proper height ‘0’, where in non hidden rows seem to have some issue copying row heights.

Below is the sample code that I used. Also, I am attaching the sample file I have used for further analysis. Kindly validate Image properties after copying the Range.

/** Code piece **/
private static final int START_COL = 0;
private static final int END_COL = 500;
private static final int START_ROW = 0;
private static final int END_ROW = 15;

Workbook wb = new Workbook(new FileInputStream(new File(path + fileName + extension)));
Worksheet workSheet = wb.getWorksheets().get(0);

PasteOptions pasteOptions = new PasteOptions();


Workbook tempWorkBookForReference = new Workbook();
Worksheet tempWorkSheetForRerence = tempWorkBookForReference.getWorksheets().get(0);

Range target = tempWorkSheetForRerence.getCells().createRange(START_ROW, START_COL,
Range src = workSheet.getCells().createRange(START_ROW, START_COL,

target.copy(src, pasteOptions); + fileName + “_CopyWithPasteOptions” + extension);

/** Code piece **/

Kindly validate and advice me of what can be done to achieve copying a Range from one sheet to another with Column_Widths, Row_Heights, Values, Formatting, Formula, Validations etc… (18.4 KB)



We were able to observe the issue but we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSJAVA-42724 - Copy a Range with Paste Options PasteType.ALL not copying row heights properly


This is to inform you that we have fixed your issue now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.

Much appreciated,

Looking forward to validate it.



You are welcome.


Please find attached our latest version/fix: Aspose.Cells for Java v18.9.3

Your issue should be fixed in it.

Let us know your feedback.
Aspose.Cells for (6.3 MB)

The issues you have found earlier (filed as CELLSJAVA-42724) have been fixed in Aspose.Cells for Java 18.10. You can also get the latest Aspose.Cells for Java version from Maven repos. with simple configurations. Please see the document for your reference: Installation|Documentation

This message was posted using BugNotificationTool from Downloads module by Amjad_Sahi