I have an excel sheet which has a formula reference to another sheet of the same workbook.
Currently, I'm on Sheet 1 and trying to set a formula for a cell using cell.setFormula(Sheet2[#All])
.
While I'm doing that, I'm encountering the following error :
Specified named range 'Sheet2' does not exist in the current workbook. org.apache.poi.ss.formula.FormulaParseException at org.apache.poi.ss.formula.FormulaParser.parseNonRa nge(FormulaParser.java:569) at org.apache.poi.ss.formula.FormulaParser.parseRange able(FormulaParser.java:429) at org.apache.poi.ss.formula.FormulaParser.parseRange Expression(FormulaParser.java:268) at org.apache.poi.ss.formula.FormulaParser.parseSimpl eFactor(FormulaParser.java:1119) at org.apache.poi.ss.formula.FormulaParser.percentFac tor(FormulaParser.java:1079) at org.apache.poi.ss.formula.FormulaParser.powerFacto r(FormulaParser.java:1066) at org.apache.poi.ss.formula.FormulaParser.Term(Formu laParser.java:1426) at org.apache.poi.ss.formula.FormulaParser.additiveEx pression(FormulaParser.java:1526) at org.apache.poi.ss.formula.FormulaParser.concatExpr ession(FormulaParser.java:1510) at org.apache.poi.ss.formula.FormulaParser.comparison Expression(FormulaParser.java:1467) at org.apache.poi.ss.formula.FormulaParser.Arguments( FormulaParser.java:1051) at org.apache.poi.ss.formula.FormulaParser.function(F ormulaParser.java:936)
However, in the workbook, I have created the necessary sheet. The sheet name is Sheet2
. But still the code is not able to refer to that sheet. Is there a way to fix this issue or any workaround?
Sheet2
is missing a space to matchSheet 2
. – Jonathan Drapeau