Loading an Excel workbook with more than 4000 rows causes an exception in Java

I am using aspose 18.12 jar file
1.String FILE_NAME=“D:\AmazonService\sheet0.xlsx”;
2. com.aspose.cells.Workbook sortinWorkbook=new com.aspose.cells.Workbook(FILE_NAME);

“java.lang.ArrayIndexOutOfBoundsException: -32768” error throws in 2nd line while accepting excel file and creating workbook. here i attached excel file which throws an errorExcel Sheet.zip (407.4 KB)
. kindly respond and give solution as soon as possible.

@senthi11,

Thanks for the template file(s) and sample code.

After an initial test, I am able to observe the issue as you mentioned. I found an exception “java.lang.ArrayIndexOutOfBoundsException: -32768” when loading your XLSX file.
I have already logged a ticket with an id “CELLSJAVA-42799” for your issue.

We will look into it soon.

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

1 Like

@senthi11,

Please check which tools are used to create this file, there are some invalid records as the following:

<xf applyFont=“true” borderId=“0” fillId=“0” fontId="-31948" numFmtId=“0” xfId=“0”>
<alignment horizontal=“right”/>
</xf>

We will ignore these records to fix this issue.

1 Like

Can you please suggest how to remove those unwanted elements in my excel file. I can’t find where it is . Maybe those elements are hidden. Thank you in advance.

@senthi11,

Please spare us a little time (3-5 working days or so). Hopefully we will fix (as we told you that we will ignore such kind of invalid records) it and provide you the fixed version soon.

1 Like

@senthi11,

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

Your issue should be fixed in it.

Let us know your feedback.
Aspose.Cells for Java_v18.12.9.zip (6.4 MB)

1 Like

It works like a charm. Wonderful . Thank you for your time spent for me. :kissing_heart::kissing_heart:

@senthi11,

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

1 Like

The issues you have found earlier (filed as CELLSJAVA-42799) have been fixed in Aspose.Cells for Java 19.1. You can also get the latest Aspose.Cells for Java version from Maven repos. with simple configurations. Please see the document for your reference: Installation|Documentation

This message was posted using BugNotificationTool from Downloads module by Amjad_Sahi