Please see and run the following sample code with the attached template file for your reference. In the template file’s first worksheet cells, e.g B1:B9 have formulas in it. We will replace the formulas with their calculated values accordingly:
Workbook workbook = new Workbook(“Bk_pastespecial.xlsx”);
Cells cells = workbook.getWorksheets().get(0).getCells();
//Create source and destination ranges accordingly.
Range range = cells.createRange(“B1:B9”);
Range dRange = cells.createRange(“B1:B9”);
//Calculate the formulas to get calculated values in the formula cells.
PasteOptions options = new PasteOptions();
Let us know if I can be of any further help.