|
Hi there, I’m desperately need some help regarding cell
formula. I’m using
HSSFCell cell = row.getCell(n); If (cell.getCellType ==
HSSFCell.CELL_TYPE_FORMULA) {
String formula = cell.getCellFormula(); } What I’ve got is this value
“NO
IDEA SHARED FORMULA EXP PTG” The formula
is very simple: =A2*B2.
HSSFFormulaEvaluator
evaluator = new HSSFFormulaEvaluator(sheet, wb); HSSFRow
row = sheet.getRow(n); HSSFCell
cell = row.getCell(n); CellValue
cellValue = evaluator.evaluate(cell); After
this I get a NullPointerException on the last line. So I
change it to: CellValue
cellValue = evaluator.evaluateInCell(cell); Still
get the NullPointerException I’ve
check thru the debugger the evaluator is not null, nor the cell. I’ve
even tried to use CellReference instead, but still the same problem. I’ve
attached the excel file and the sample source code. I
really appreciate in advance your help. Thanks
and God Bless Jun
Victorio |
formula.xls
Description: MS-Excel spreadsheet
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
