I'm parsing Excel file from EUSES data set. When get formula of name 'Database' with range ='file:///HEPPC3/gt$/Teaching/Syn/[physyn.xls]#REF'!$AK$70:$AL$70 It throw null pointer exception: ... for(Name rangedName : wb.getAllNames()) if (!rangedName.isFunctionName()) { xlWorkbook.addNamedRange(rangedName.getNameName(), rangedName.getRefersToFormula()); } ... Exception in thread "main" java.lang.NullPointerException at org.apache.poi.ss.formula.ptg.ExternSheetNameResolver.prependSheetName(ExternSheetNameResolver.java:40) at org.apache.poi.ss.formula.ptg.Area3DPtg.toFormulaString(Area3DPtg.java:104) at org.apache.poi.ss.formula.FormulaRenderer.toFormulaString(FormulaRenderer.java:91) at org.apache.poi.hssf.model.HSSFFormulaParser.toFormulaString(HSSFFormulaParser.java:119) at org.apache.poi.hssf.usermodel.HSSFName.getRefersToFormula(HSSFName.java:204) Sheetname is null. I guess sheet name is #REF error in Excel. Should it return #REF or the index of sheet? Attached file is test file to replicate the issues.
Created attachment 34511 [details] test file
*** Bug 60459 has been marked as a duplicate of this bug. ***
Move this bug from HSSF to SS common component.
This is fixed via r1850008 now by adding some null-checks and returning #REF for workbook-name and sheetname if needed.