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

Free Support Forum - aspose.com

Some background colors are changed using copy range

Some colors are changed using copy range. Please see the code and the attached files for your reference.
Please advise how to fix this error to copy exactly the same background colors from the source to the destination.
String dataDir = "C:\\development_tools\\";
Workbook sourceBook = new Workbook(dataDir + "Source.xlsx");
final Range sourceRange = sourceBook.getWorksheets().getRangeByName("ColorRange");

final Workbook destBook = new Workbook();
final Worksheet worksheet = destBook.getWorksheets().get(0);
final Range destRange =
worksheet.getCells().createRange(0, 0, sourceRange.getRowCount(), sourceRange.getColumnCount());
destBook.save(dataDir + "Destination.xlsx");


Thanks for providing us template file and sample code.

After an initial test, I observed the issue as you mentioned by using your template file and sample code. I found that some background colors of cells (in the worksheet) are changed in copying ranges b/w workbooks. I have logged a ticket with an id “CELLSJAVA-42151” for your issue. We will look into it soon.

Once we have an update on it or we figure your issue out, we will let you know here.

Thank you.


Thanks for using Aspose.Cells.

Please copy theme from the source file too for now.

See the following code:

Workbook destBook = new Workbook();

However, we are still working on this issue and fix it asap.

Thanks for you quick reply.

It works.


Good to know that it figures out your issue now. Feel free to contact us any time if you have any other issue or queries, we will be happy to assist you soon.

Thank you.