Class XSSFFormulaUtils
java.lang.Object
org.apache.poi.xssf.usermodel.helpers.XSSFFormulaUtils
Utility to update formulas and named ranges when a sheet name was changed
- Author:
- Yegor Kozlov
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
updateSheetName
(int sheetIndex, String oldName, String newName) Update sheet name in all charts, formulas and named ranges.
-
Constructor Details
-
XSSFFormulaUtils
-
-
Method Details
-
updateSheetName
Update sheet name in all charts, formulas and named ranges. Called fromXSSFWorkbook.setSheetName(int, String)
The idea is to parse every formula and render it back to string with the updated sheet name. This is done by parsing into Ptgs, looking for ones with sheet references in them, and changing those
- Parameters:
sheetIndex
- the 0-based index of the sheet being changedoldName
- the old sheet namenewName
- the new sheet name
-