https://bz.apache.org/bugzilla/show_bug.cgi?id=59132
--- Comment #3 from [email protected] --- I have written a test code for the issue: import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import org.apache.poi.EncryptedDocumentException; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.FormulaEvaluator; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.WorkbookFactory; import org.apache.poi.ss.util.CellReference; public class TestCountBlank { public static void main(String[] args) { try { File excelFile = new File("D:\\test blank.xlsx"); FileInputStream input; input = new FileInputStream(excelFile); Workbook workbook = WorkbookFactory.create(input); Sheet worksheet = workbook.getSheet("sheet1"); CellReference ref = new CellReference("B3"); Row row = worksheet.getRow(ref.getRow()); Cell cell = row.getCell(ref.getCol()); cell.setCellValue((String)null); FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); CellReference ref2 = new CellReference("A5"); Row row2 = worksheet.getRow(ref2.getRow()); Cell cell2 = row2.getCell(ref2.getCol()); evaluator.evaluateFormulaCell(cell2); FileOutputStream output = new FileOutputStream(excelFile); workbook.write(output); output.flush(); output.close(); workbook.close(); } catch (EncryptedDocumentException | InvalidFormatException | IOException e) { e.printStackTrace(); } } } The code automatically delete "Alice" at cell B3 and evaluate COUNTBLANK() formula at cell A5, the result of COUNTBLANK() is still zero. -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
