Aspose.Cells for Java -Issues in save workbook with xlsm type

Hi:
I’m use aspose.cell (version is 2020.3) for java.
I get workbook instance from excel file which type is xlsm, When i remove some sheet in this workbook, i can’t save the workbook with the same type(xlsm).
The exception info:
java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at com.aspose.cells.zcii.a(Unknown Source)
at com.aspose.cells.zcii.a(Unknown Source)
at com.aspose.cells.zcii.b(Unknown Source)
at com.aspose.cells.zcii.a(Unknown Source)
at com.aspose.cells.VbaProject.a(Unknown Source)
at com.aspose.cells.zrl.E(Unknown Source)
at com.aspose.cells.zrl.o(Unknown Source)
at com.aspose.cells.zrl.(Unknown Source)
at com.aspose.cells.ze.b(Unknown Source)
at com.aspose.cells.zyd.b(Unknown Source)
at com.aspose.cells.ze.a_(Unknown Source)
at com.aspose.cells.zyd.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)

@qinghualiu,
Please share your sample file and code snippet with us for our testing. We will reproduce the problem and provide our feedback after analysis.

I use the file in attachment.
My test code is :

    String sourceDir = Utils.Get_SourceDirectory();

    Workbook workbook = new Workbook(sourceDir + "clean_remove_sheet_error.xlsm");


    workbook.getWorksheets().removeAt("输入");


    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();

    workbook.save(outputStream, FileFormatType.XLSM);

If i don’t remove the sheet , it save successfully.
clean_remove_sheet_error.xlsm.zip (17.1 KB)

@qinghualiu,
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-43149 – Exception raised while saving XLSM after removing worksheet

I found the issue has resolved, so how can i get the correct Aspose library.

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

@qinghualiu,

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

Your issue should be fixed in it.

Let us know your feedback.
aspose-cells-20.3.3-java.zip (7.0 MB)

Good job! It can work fine.

When will this version be released?

Thanks for your support!

@qinghualiu,
We only publish official releases on Nuget\maven repos. The hotfix, i.e., Aspose.Cells for Java v20.3.3 is fully tested and includes all the features (full fledged) and previous fixes and enhancements, so you may use it on production server. It is safe to use the hotfix on the server. However, if you still want the version to be uploaded, then you have to wait for our next official release of the product. We will publish our next official release, i.e., Aspose.Cells for Java v20.4 (which will also include your fix) in the third week of April, 2020.

1 Like

The issues you have found earlier (filed as CELLSJAVA-43149) have been fixed in Aspose.Cells for Java v20.4. This message was posted using Bugs notification tool by ahsaniqbalsidiqui