if (externalSheet == null || externalSheet.getWorkbookName() == null) {
// sheet is in same workbook
targetEvaluator = _bookEvaluator;
- otherFirstSheetIndex = _workbook.getSheetIndex(externalSheet.getSheetName());
+ if(externalSheet == null) {
+ otherFirstSheetIndex = 0;
+ } else {
+ otherFirstSheetIndex = _workbook.getSheetIndex(externalSheet.getSheetName());
+ }
if (externalSheet instanceof ExternalSheetRange) {
String lastSheetName = ((ExternalSheetRange)externalSheet).getLastSheetName();
wb.close();
}
+
+ @Test
+ public void test57925() throws IOException {
+ Workbook wb = HSSFTestDataSamples.openSampleWorkbook("57925.xls");
+
+ wb.getCreationHelper().createFormulaEvaluator().evaluateAll();
+
+ for(int i = 0;i < wb.getNumberOfSheets();i++) {
+ Sheet sheet = wb.getSheetAt(i);
+ for(Row row : sheet) {
+ for(Cell cell : row) {
+ new DataFormatter().formatCellValue(cell);
+ }
+ }
+ }
+
+ wb.close();
+ }
}