I am trying to read an Excel file which is using the =SHEET(A1)
function. I am getting following stacktrace:
Caused by: org.apache.poi.ss.formula.eval.NotImplementedFunctionException: _xlfn.SHEET
at org.apache.poi.ss.formula.UserDefinedFunction.evaluate(UserDefinedFunction.java:65)
at org.apache.poi.ss.formula.OperationEvaluatorFactory.evaluate(OperationEvaluatorFactory.java:135)
at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:537)
at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:264)
I did not find out how to write a proper workaround for that since the FunctionEval.registerFunction
method returns me, that "SHEET" is an unknown function.
Do you know how to solve that - if necessary with a very dirty hack.
Thanks for any idea
It turned out that the SHEET function was not registered as part of the AnalysisToolPak. It was now added in #22192ce
I added a PR to add full SHEET support in https://github.com/apache/poi/pull/803