I've tried several things to get the Workbook.save() method to save, but everytime i try i get the following stack trace:
java.lang.NullPointerException
at com.aspose.cells.b.a.b.g.(Unknown Source)
at com.aspose.cells.b.a.b.g.(Unknown Source)
at com.aspose.cells.pk.a(Unknown Source)
at com.aspose.cells.pk.a(Unknown Source)
at com.aspose.cells.pk.a(Unknown Source)
at com.aspose.cells.Worksheet.autoFitRow(Unknown Source)
at com.aspose.cells.kw.a(Unknown Source)
at com.aspose.cells.WorksheetCollection.r(Unknown Source)
at com.aspose.cells.WorksheetCollection.a(Unknown Source)
at com.aspose.cells.WorksheetCollection.b(Unknown Source)
at com.aspose.cells.WorksheetCollection.a(Unknown Source)
at com.aspose.cells.WorksheetCollection.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)
The code i used ranged from my own to the sample included in the JavaDoc:
//Open a designer file
String designerFile = "designer.xls";
Workbook workbook = new Workbook(designerFile);//Set scroll bars
workbook.setHScrollBarVisible(false);
workbook.setVScrollBarVisible(false);
//Replace the placeholder string with new values
int newInt = 100;
workbook.replace("OldInt", newInt);
String newString = "Hello!";
workbook.replace("OldString", newString);
XlsSaveOptions saveOptions = new XlsSaveOptions();
workbook.save("result.xls", saveOptions);
I've tried several combinations of how save is called including creating a workbook from scratch (not from an existing file) and writing to an output stream (the method i intend to use). I even fixed the code by wrapping save in a try-catch so it would compile.
Reverting back to version 2.5.4 allows me to save files, but there are other issues involving an inability to sort and problems when using the auto filter. Is there anything we can do to get save working so i can use v7?