I've written Java POI code to open an Excel file and set a cell's formula by using "setCellFormula()". The code compiles and correctly updates the field's formula, but the value is not calculated. For example, a cell's value might be set to "=2+2" by calling
cell.setCellFormula("2+2");
and the string gets inserted into the cell.
It only calculates the value "4" if I open the excel spreadsheet, click into the cell, and press the Enter-key... only then does it show the calculated value.
How can I cause the cell to compute the value without my having to open and interact with the file? Is there a refresh() or maybe update() or compute() that I should use?
Thank in advance.
cell.setCellFormula("2+2");
and the string gets inserted into the cell.
It only calculates the value "4" if I open the excel spreadsheet, click into the cell, and press the Enter-key... only then does it show the calculated value.
How can I cause the cell to compute the value without my having to open and interact with the file? Is there a refresh() or maybe update() or compute() that I should use?
Thank in advance.