Exception while evaluating formula CELL using Apache POI

3.2k Views Asked by At

I am getting following exception when trying to evaluate all cell in workbook. I am using version 3.13 for Apache poi. Formula is CELL("filename")

org.apache.poi.ss.formula.eval.NotImplementedFunctionException: CELL

Is there any way to make it work? Or is there any other formula which will give me the same result?

2

There are 2 best solutions below

0
On

According to this site, the function CELL is not supported/implemented in Apache POI.

I ran into a similar problem in a project a year or so ago. We ended up creating a user defined function in excel, which we then reimplemented in Java. Check this link for more information on user defined functions.

0
On

In my case, the formula evaluator did not work. We decided to extract the numerical value from the function cell using cell.getNumericCellValue(), getting the result of evaluating the function:

XSSFFormulaEvaluator formulaEvaluator = new XSSFFormulaEvaluator(workbook);

formulaEvaluator.evaluateInCell(cell); // NotImplementedException (caused by NotImplementedFunctionException)
cell.getNumericCellValue();            // OK

Apache POI version 3.17