https://issues.apache.org/bugzilla/show_bug.cgi?id=53178

          Priority: P2
            Bug ID: 53178
          Assignee: [email protected]
           Summary: RunTimeException: "Unexpected tAttr" in
                    getCellFormula()
          Severity: major
    Classification: Unclassified
                OS: Windows XP
          Reporter: [email protected]
          Hardware: PC
            Status: NEW
           Version: 3.8
         Component: HSSF
           Product: POI

Created attachment 28709
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28709&action=edit
Small example for the bug

Hi,

I got the following problem, I try to read the cell formula from an HSSFCell,
of cell type "HSSFCell.CELL_TYPE_FORMULA":

if (cell.getCellType() == HSSFCell.CELL_TYPE_FORMULA) {
  String formula = cell.getCellFormula();
}


This all works well, unless in the attached excel sheet, where I get the
following excpetion:

Exception in thread "main" java.lang.RuntimeException: Unexpected tAttr:
org.apache.poi.ss.formula.ptg.AttrPtg []
        at
org.apache.poi.ss.formula.FormulaRenderer.toFormulaString(FormulaRenderer.java:87)
        at
org.apache.poi.hssf.model.HSSFFormulaParser.toFormulaString(HSSFFormulaParser.java:83)
        at
org.apache.poi.hssf.usermodel.HSSFCell.getCellFormula(HSSFCell.java:628)


I don't really see the point. I assume, this is because the formula in the cell
is rather long:

=WENN('E:\Berichtswesen\Programme\pis_esm.xla'!Twert(#BEZUG!C320;"h";#BEZUG!;#BEZUG!)/1000<LTC_ENTRY_FLEX_MIN/(23+ABS(SOWI-2))*1000-1;1;WENN('E:\Berichtswesen\Programme\pis_esm.xla'!Twert(#BEZUG!C320;"h";#BEZUG!;#BEZUG!)/1000>LTC_ENTRY_FLEX_MAX/(23+ABS(SOWI-2))*1000+1;1;0))

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to