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

Free Support Forum - aspose.com

Copy/Save produces Corrupt File

Attached is a java program that demonstrates the Workbook.copy(src) followed by a Workbook.save(…) generates an invalid file.

Please download AsposeCopyIssue.7z from https://spideroak.com/browse/share/arcticpenguin/aspose/aspose-bug/

The program generates two files in the temp folder. One prefixed with ‘original’ the other prefixed with ‘copy’. Attempt opening the files with excel. Notice that the one prefixed with ‘original’ opens without an error. When opening the file prefixed with ‘copy’ Excel will report the file as being corrupted.

@andyczerwonka

We have tested this issue with the following sample code and found the issue. 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 news for you, we will update you asap.

This issue has been logged as

  • CELLSJAVA-42373 - Copying workbook and then saving corrupts the output Excel file

Download Links:
source-excel-file.zip (44.0 KB)
output-excel-file-after-copy.zip (43.1 KB)

Java

Workbook workbook = new Workbook(dirPath + "aspose-copy-issue.xlsx");

Workbook copy = new Workbook();
copy.copy(workbook);

copy.save(dirPath + "outputCopy.xlsx");

@andyczerwonka

Thanks for using Aspose APIs.

This is to inform you that we have fixed your issue CELLSJAVA-42373 now. We will soon provide the fix after performing QA and including other enhancements and fixes.

@andyczerwonka

Please download and try the following fix and let us know your feedback.

1 Like

The issues you have found earlier (filed as CELLSJAVA-42373) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.