I use HSSF POI to update a spreadsheet with data taken from a database. I have a totals row that takes the sum of a range of cells as seen in the image below:
http://www.nabble.com/file/p18443463/example.jpg TOTALS ROW When i open the file after it has been populated with the information using OpenOffice the totals row has the correct values in it. However, when i open the file using MS Excel the value in the cell is #VALUE! and not the nurmeric value it should be. I am using POI 3.1 and the code i use to recalculate the values is: for(int sheetNum = 0; sheetNum < wb.getNumberOfSheets(); sheetNum++) { HSSFSheet sheet = wb.getSheetAt(sheetNum); HSSFFormulaEvaluator evaluator = new HSSFFormulaEvaluator(sheet, wb); for(Iterator<?> rit = sheet.rowIterator(); rit.hasNext();) { HSSFRow r = (HSSFRow)rit.next(); evaluator.setCurrentRow(r); for(Iterator<?> cit = r.cellIterator(); cit.hasNext();) { HSSFCell c = (HSSFCell)cit.next(); if(c.getCellType() == HSSFCell.CELL_TYPE_FORMULA) { evaluator.evaluateFormulaCell(c); } } } Anyone got any suggestions to what is happen? many thanks mark -- View this message in context: http://www.nabble.com/Cell-Formula-not-refreshed-tp18443463p18443463.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]
