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

Free Support Forum - aspose.com

Aspose cells java- ClassCastException instantiating workbook


We are using aspose cells java to export to an excel. And we are getting this exception. Can you please help. We have been using this for a while and it works without any error for most reports but we get this in few cases .

Exception: Exporting Aspose Excel :com.aspose.cells.b.a.d.h cannot be cast to com.aspose.cells.adg
java.lang.ClassCastException: com.aspose.cells.b.a.d.h cannot be cast to com.aspose.cells.adg
at com.aspose.cells.acm.a(Unknown Source)
at com.aspose.cells.acm.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.(Unknown Source)

Code snippet:
It fails with the above exception when it tries to create an instance of the workbook.
reportInputStream = new ByteArrayInputStream(lBinaryExcelReportData);
reportWorkbook = new Workbook(reportInputStream);

Hi Diane,

Thank you for contacting Aspose support.

First of all, please note that we have moved this thread from Aspose.Total to Aspose.Cells support forum because your inquiry relates to the Aspose.Cells APIs alone.

In order to troubleshoot your presented scenario, we will require your complete source code (at least a sample application) along with problematic input spreadsheet (if any) and environment details to replicate the problem on our end. Once we are able to reproduce the exception, we can quickly move forward towards the correction of the problem by logging appropriate tickets in our bug tracking system.

Before you provide the above requested information, we would request you to please download and use the latest version of Aspose.Cells for Java 8.1.0 on you side to see if you still can replicate the said exception. In case the problem persists, please reply back with additional information as requested in above para.