Nick,
Thanks very much. It (of course) worked. I should have read more of the
javadoc and figured it out myself..
Lenny Wintfeld
Nick Burch wrote:
On Wed, 12 Dec 2007, Lenny Wintfeld wrote:
From the http://poi.apache.org/hssf/eval.html web page, using the
HSSFFormulaEvaluator all seems simple. But I'm having trouble getting
a simple test program to run. I'm sure it must be cockpit error on my
part, but I just don't see what it is.
There was one crucial line missing from the docs. Fixed docs should be
on the site in an hour or so.
You need to tell the evaluator what row it's working on, with a call
to setCurrentRow(row)
// suppose your formula is in B3
CellReference cellReference = new CellReference("C5");
HSSFRow row = sheet.getRow(cellReference.getRow());
HSSFCell cell = row.getCell(cellReference.getCol());
// This was missing
evaluator.setCurrentRow(row)
if (cell!=null) {
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]