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

Free Support Forum - aspose.com

Saving an Excel file gives ArrayIndexOutOfBoundsException in Java

Hello,

I have the same error with 2 new files (using aspose-cells-16.12.0) :

  • InvalidColumn_2.xlsx
  • InvalidColumn_3.xlsx

Error : java.lang.ArrayIndexOutOfBoundsException: 88


Do you want I open a new thread ?

Thank you.

Hi,


Thanks for providing us template files.

Please try our latest fix/version: Aspose.Cells for Java v16.12.6

I have tested your scenario/ case using your newly attached files, it works fine with v16.12.6. I have used your original code with your new files:
e.g
Sample code:
//New workbook with document

Workbook workbook = new Workbook(“InvalidColumn_3.xlsx”);

//For each sheet

for (int i = 0; i<workbook.getWorksheets().getCount(); i++) {

//Get sheet

Worksheet worksheet = workbook.getWorksheets().get(i);

//Sheet render

ImageOrPrintOptions printOpts = new ImageOrPrintOptions();

SheetRender sr = new SheetRender(worksheet, printOpts);

}

Let us know if you still have any issue with v16.12.6.

Thank you.

You have error only if you save your workbook ath the end:

workbook.save(“yourTempPath”);

Hi,


Thanks for providing us further details.

After an initial test, I observed the issue as you mentioned by simply opening and resaving the files (InvalidColumn_2.xlsx and InvalidColumn_3.xlsx). I found an exception: java.lang.ArrayIndexOutOfBoundsException on Workbook.save() method:
e.g
Sample code:

Workbook workbook = new Workbook(“InvalidColumn_2.xlsx”);
workbook.save(“out1.xlsx”);

I have logged a ticket with an id “CELLSJAVA-42143” for your issue. We will look into it soon.

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

Thank you.

It seems to appear when we have hidden column(s) in a document.

Hi,


Thanks for sharing your findings.

Please spare us little time to properly investigate and analyse your issue.

Hopefully your issue would be fixed before the end of next week.

Thank you.
Hi again,

This is to update you that the ticket logged earlier as CELLSJAVA-42143 has been marked resolved. We will shortly share the fix here for your testing.

Hi,


Please try our latest version/fix: Aspose.Cells for Java v16.12.7

Your issue should be fixed in it.

Let us know your feedback.

Thank you

It works fine.

Thank you.

Hi,


Thanks for your feedback.

Good to know that your issue is sorted out by the new fix/version. Feel free to write us back if you have questions or comments, we will be happy to assist you soon.

Thank you.

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


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