This is the a simple code:
public static void main(String[] args) throws IOException {
wbA = new HSSFWorkbook(new FileInputStream("D:/Book1.xls"));
wbA.getSheetAt(0).getRow(1).getCell(0).setCellValue("Sheet2");
evalA = (HSSFFormulaEvaluator)
wbA.getCreationHelper().createFormulaEvaluator();
evalA.evaluateFormulaCell(wbA.getSheetAt(0).getRow(3).getCell(0));
printCell(0,"A4");
}
public static void printCell(int sheet, String str)
{
CellReference cellReference = new CellReference(str);
Row row = wbA.getSheetAt(sheet).getRow(cellReference.getRow());
Cell cell = row.getCell(cellReference.getCol());
evalA.clearAllCachedResultValues();
evalA.evaluate((HSSFCell) cell);
System.err.println("Cell
"+str+"="+evalA.evaluate(cell).getNumberValue());
} And attached is the file. The output is: Cell A4=0.0 and I expected 100.0 Regards, Adrian Josh Micich schreef:
Evaluation support for INDIRECT() was added recently: https://issues.apache.org/bugzilla/show_bug.cgi?id=47721 This happened before 3.5-final. Please reply with a your sample code, but most importantly please also include the stack trace of your error. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Book1.xls
Description: MS-Excel spreadsheet
--------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
