poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 60460] New: Null pointer exception in ExternSheetNameResolver.prependSheetName method
Date Fri, 09 Dec 2016 04:29:03 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=60460

            Bug ID: 60460
           Summary: Null pointer exception in
                    ExternSheetNameResolver.prependSheetName method
           Product: POI
           Version: 3.15-FINAL
          Hardware: Macintosh
                OS: Mac OS X 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
          Assignee: dev@poi.apache.org
          Reporter: zhangchaowang@gmail.com
  Target Milestone: ---

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message