Closed Taha-Di-Nero closed 7 years ago
Hi, Upgrading to Savorboard.NPOI.Core.Ooxml 1.1.4 (was using DotNetCore.NPOI 1.0.0), the problem change to the line when formula are evaluated
WorkbookFactory.CreateFormulaEvaluator(wb).EvaluateAll(); At this line an exception is thrown:
$exception {System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. at System.ThrowHelper.ThrowKeyNotFoundException() at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at Npoi.Core.SS.Formula.WorkbookEvaluator.GetSheetIndex(IEvaluationSheet sheet) at Npoi.Core.SS.Formula.WorkbookEvaluator.Evaluate(IEvaluationCell srcCell) at Npoi.Core.XSSF.UserModel.XSSFFormulaEvaluator.EvaluateFormulaCellValue(ICell cell) at Npoi.Core.XSSF.UserModel.XSSFFormulaEvaluator.EvaluateFormulaCell(ICell cell) at Npoi.Core.HSSF.UserModel.HSSFFormulaEvaluator.EvaluateAllFormulaCells(IWorkbook wb, IFormulaEvaluator evaluator)
Removing that line everything work fine and somehow when I open the generated xlsx file formula are already evaluated. Nb: I had ported an export using java apache poi code to .net core and in java was a must eveluting formula before closing WorkBook
Thanks for saving me a lot of time.
Hi, When I set the cell Formula, an exception arise: "System.ArgumentNullException: 'Value cannot be null.'"
Any help??