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

Free Support Forum - aspose.com

Content duplication (embedded Word) when copying worksheet

Dear Aspose Support Team

We have a template excel file (Template.xlsx) which contains a worksheet with an embedded Word document. We would like to copy this worksheet into a new workbook (Result.xlsx).
When doing this, however, the content of the embedded Word document is duplicated: a picture with the content of the embedded Word document is shown on top of the actual embedded Word document content.
Why does this happen? How can we prevent this? We only want the actual embedded Word document content in the result file, no additional picture.

This is the code we are using to copy the worksheet:

workbook = new Workbook();
workbook.getWorksheets().removeAt(0);

Workbook templateWorkbook = new Workbook(TEMPLATE_FILE);
Worksheet sourceSheet = templateWorkbook.getWorksheets().get(TEMPLATE_SHEET);
int index = workbook.getWorksheets().add();
Worksheet newSheet = workbook.getWorksheets().get(index);
newSheet.copy(sourceSheet);

workbook.save(TARGET_FILE);

DuplicateWordTextIssue.zip (93.5 KB)

@awepler,

Please notice, we were able to reproduce the issue as you mentioned by using your sample code with your template file. We found embedded Ole Object is not copied correctly as per in the source file. We have logged a ticket with an id “CELLSJAVA-43270” for your issue. We will look into it soon.

Once we have an update on it, we will let you know.

@awepler,
This is to inform you that we have fixed your issue (logged earlier as “CELLSJAVA-43270”) now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.

@awepler,

Please try our latest version/fix: Aspose.Cells for Java v20.8.6 (attached)

Your issue should be fixed in it.

Let us know your feedback.
aspose-cells-20.8.6-java.zip (7.2 MB)

Thank you for looking into this and providing a fix. It works fine now (we tested with version 20.8.8).

@awepler,

Good to know that your issue is sorted out by the new fix/version. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.

The issues you have found earlier (filed as CELLSJAVA-43270) have been fixed in Aspose.Cells for Java v20.9. This message was posted using Bugs notification tool by ahsaniqbalsidiqui.
You may also get the new version @ Maven repos. (https://repository.aspose.com/webapp/#/artifacts/browse/tree/General/repo/com/aspose/aspose-cells/20.9)