npoi icon indicating copy to clipboard operation
npoi copied to clipboard

Indirect Name not Evaluated Correctly.

Open crippledfaith opened this issue 1 year ago • 0 comments

When Evaluating formula =IF(ISREF(INDIRECT(Investment.DepositPensionSchemes.1.BankName)),Investment.DepositPensionSchemes.1.BankName,"") Indirect.EvaluateIndirect takes the String value of the cell, and tries to find the DynamicReference of the Value instead of the Name.

Gets an object reference error in OperationEvaluationContext.GetDynamicReference() at line 252. IEvaluationName nm = ((IFormulaParsingWorkbook)_workbook).GetName(refStrPart1, _sheetIndex); nm is set to null.

IWorkbook workbook; var formFilePath = "FormRR32.xlsx"; using (FileStream file = new FileStream(formFilePath, FileMode.Open, FileAccess.Read)) { workbook = new XSSFWorkbook(file); workbook.MissingCellPolicy = MissingCellPolicy.RETURN_NULL_AND_BLANK; } for (int i = 0; i < workbook.NumberOfNames; i++) { nameList.Add(workbook.GetNameAt(i)); } XSSFFormulaEvaluator formula = new XSSFFormulaEvaluator(workbook); formula.EvaluateAll()

Nuget: NPOI 2.6.0, Branch: master

FormRR32.xlsx

crippledfaith avatar Jun 01 '23 05:06 crippledfaith