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

Free Support Forum - aspose.com

Getting java.lang.IllegalArgumentException: Invalid sheet index: 65535


We are using the Aspose.Cells.jar (version in Production/QA environment. We are getting an exception when we are trying to save and then open a workbook using Aspose APIs.

Below is the stack trace:

java.lang.IllegalArgumentException: Invalid sheet index: 65535
at com.aspose.cells.Worksheets.b(Unknown Source)
at com.aspose.cells.Worksheets.getSheet(Unknown Source)
at com.aspose.cells.fy.e(Unknown Source)
at com.aspose.cells.fy.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.open(Unknown Source)

We are not able to simulate this issues because we get this error intermittently. Unfortunately we wont be able to provide you with any demo program.

Can you please tell me what is the root cause & when this exception will occur?

Thanks & Regards

Karuppiah M


Could you try our attached latest version/fix v2.2.1.3 in which we have enhanced some features and fixes some other issues.

If you still find the issue, I am afraid, we need your template file and sample code to reproduce the issue you have talked about.

Thank you.

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Please try the attached latest version of Aspose.Cells. We think maybe in your program you have set an illegal active sheet for the workbook. For example, set one sheet of workbook1 as the active sheet of workbook2. Anyways, we have enhanced some of our APIs to avoid such invalid operation and removed some illegal data when reading template files. If you still get such exception, I am afraid we need the template file and sample code to trace the root cause for it.

Thank You & Best Regards,