Well, the only thing that I can see frm the snippet of code you posted is this line;
evalA.clearAllCachedResultValues(); Whilst it is a perfectly valid method to call, it does not appear in any of the examples on this page as far as I can remember; http://poi.apache.org/spreadsheet/eval.html and I wonder if it could - and that is could - be causing you problems. Yours Mark B Adrian Butnaru wrote: > > Hi, > I am building a web application using POI-3.5-FINAL-20090928.jar. > When I am calculating a sum in a cell wtih this code: > -------------------- > Cell cell = risksheet.getRow(60).getCell(k); > evalA.evaluateFormulaCell(cell); > evalA.clearAllCachedResultValues(); > val = > risksheet.getRow(60).getCell(k).getNumericCellValue(); > -------------------- > I am receiving the following error: > > java.lang.IllegalStateException: Cannot get a numeric value from a error > formula cell > org.apache.poi.hssf.usermodel.HSSFCell.typeMismatch(HSSFCell.java:616) > org.apache.poi.hssf.usermodel.HSSFCell.checkFormulaCachedValueType(HSSFCell.java:621) > org.apache.poi.hssf.usermodel.HSSFCell.getNumericCellValue(HSSFCell.java:646) > > > The formula in that cell is > > =SUM(E46:E54)+SUM(E56:E57)+SUM(E59:E60) > > I need some help please, maybe someone more experienced can suggest me > what am I doing wrong. > > Thanks, > Adrian > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > > -- View this message in context: http://old.nabble.com/Cannot-get-a-numeric-value-from-a-error-formula-cell-tp26243512p26251766.html Sent from the POI - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
