Created attachment 32524 [details] A proposed patch (not sure it's the right solution!) When an IFERROR() function is present into a cell, renaming worksheet via sheet.setSheetName() leads to a NullPointerException Here is the stacktrace java.lang.NullPointerException at org.apache.poi.xssf.usermodel.helpers.XSSFFormulaUtils.updatePtg(XSSFFormulaUtils.java:128) at org.apache.poi.xssf.usermodel.helpers.XSSFFormulaUtils.updateFormula(XSSFFormulaUtils.java:98) at org.apache.poi.xssf.usermodel.helpers.XSSFFormulaUtils.updateSheetName(XSSFFormulaUtils.java:78) at org.apache.poi.xssf.usermodel.XSSFWorkbook.setSheetName(XSSFWorkbook.java:1368) That worked on POI 3.10 release.
This should hopefully be fixed in r1675745, along with a related bug with range sheet references