I’m currently getting a NullPointerException when trying to open one of my SpreadsheetML reports. At the moment, I’m using the “aspose-cells-21.11.7.jar” patched build w/ a temporary license that I was given to resolve another issue I was having with Excel itself throwing errors when opening an Aspose-converted XLSX file. This build resolves that issue for that particular report.
But this other report, I’m getting an NPE exception in Java at the point it’s trying to open the SpreadsheetML file.
Here is the snippet of the code:
com.aspose.cells.License license = new com.aspose.cells.License(); license.setLicense(new java.io.FileInputStream("c:\\process\\Aspose.Cells.Java.lic")); FileOutputStream fos2 = new FileOutputStream(thefile.internalName()); Workbook wb = new Workbook(excelXmlFile, new LoadOptions(LoadFormat.SPREADSHEET_ML)); // This is where it's failing. "excelXmlFile" is a string path to the SpreadsheetML file wb.save(fos2, SaveFormat.EXCEL_97_TO_2003); fos2.close();
I’ve also tried using the “new Workbook(excelXmlFile)” constructor with the same exception:
Caused by: java.lang.NullPointerException at com.aspose.cells.zbor.i(Unknown Source) at com.aspose.cells.zbor.h(Unknown Source) at com.aspose.cells.zbor.a(Unknown Source) at com.aspose.cells.zbor.a(Unknown Source) at com.aspose.cells.zkn.a(Unknown Source) at com.aspose.cells.Workbook.a(Unknown Source) at com.aspose.cells.Workbook.<init>(Unknown Source)
Attached should be a sample of the SpreadsheetML I’m trying to convert to EXCEL_97_TO_2003 format this time.
Sample SpreadsheetML file.zip (3.6 KB)