XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet ws = (XSSFSheet)wb.CreateSheet("sheet1"); XSSFRow row = (XSSFRow)ws.CreateRow(0); row.CreateCell(0).SetCellValue("Name"); IName name = wb.CreateName(); name.RefersToFormula = "'sheet1'!$A$1:$A$1";
When I ran them on .Net Core 3.0+, may cause an Exception like:
Unhandled exception. System.ArgumentNullException: Value cannot be null. (Parameter 'stream') at System.IO.StreamReader..ctor(Stream stream, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean leaveOpen) at System.IO.StreamReader..ctor(Stream stream) at NPOI.SS.Formula.Function.FunctionMetadataReader.CreateRegistry() at NPOI.SS.Formula.Function.FunctionMetadataRegistry.GetInstance() at NPOI.SS.Formula.Function.FunctionMetadataRegistry.GetFunctionByName(String name) at NPOI.SS.Formula.FormulaParser.IsValidCellReference(String str) at NPOI.SS.Formula.FormulaParser.ParseSimpleRangePart() at NPOI.SS.Formula.FormulaParser.ParseRangeable() at NPOI.SS.Formula.FormulaParser.ParseRangeExpression() at NPOI.SS.Formula.FormulaParser.ParseSimpleFactor() at NPOI.SS.Formula.FormulaParser.PercentFactor() at NPOI.SS.Formula.FormulaParser.PowerFactor() at NPOI.SS.Formula.FormulaParser.Term() at NPOI.SS.Formula.FormulaParser.AdditiveExpression() at NPOI.SS.Formula.FormulaParser.ConcatExpression() at NPOI.SS.Formula.FormulaParser.ComparisonExpression() at NPOI.SS.Formula.FormulaParser.IntersectionExpression() at NPOI.SS.Formula.FormulaParser.UnionExpression() at NPOI.SS.Formula.FormulaParser.Parse() at NPOI.SS.Formula.FormulaParser.Parse(String formula, IFormulaParsingWorkbook workbook, FormulaType formulaType, Int32 sheetIndex, Int32 rowIndex) at NPOI.XSSF.UserModel.XSSFName.set_RefersToFormula(String value)
But when I change to .NET Framework 4.5.1+, they work fine.
Could you help me, please?
ps: my NPOI version is v2.5.2
XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet ws = (XSSFSheet)wb.CreateSheet("sheet1"); XSSFRow row = (XSSFRow)ws.CreateRow(0); row.CreateCell(0).SetCellValue("Name"); IName name = wb.CreateName(); name.RefersToFormula = "'sheet1'!$A$1:$A$1";
When I ran them on .Net Core 3.0+, may cause an Exception like:Unhandled exception. System.ArgumentNullException: Value cannot be null. (Parameter 'stream') at System.IO.StreamReader..ctor(Stream stream, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean leaveOpen) at System.IO.StreamReader..ctor(Stream stream) at NPOI.SS.Formula.Function.FunctionMetadataReader.CreateRegistry() at NPOI.SS.Formula.Function.FunctionMetadataRegistry.GetInstance() at NPOI.SS.Formula.Function.FunctionMetadataRegistry.GetFunctionByName(String name) at NPOI.SS.Formula.FormulaParser.IsValidCellReference(String str) at NPOI.SS.Formula.FormulaParser.ParseSimpleRangePart() at NPOI.SS.Formula.FormulaParser.ParseRangeable() at NPOI.SS.Formula.FormulaParser.ParseRangeExpression() at NPOI.SS.Formula.FormulaParser.ParseSimpleFactor() at NPOI.SS.Formula.FormulaParser.PercentFactor() at NPOI.SS.Formula.FormulaParser.PowerFactor() at NPOI.SS.Formula.FormulaParser.Term() at NPOI.SS.Formula.FormulaParser.AdditiveExpression() at NPOI.SS.Formula.FormulaParser.ConcatExpression() at NPOI.SS.Formula.FormulaParser.ComparisonExpression() at NPOI.SS.Formula.FormulaParser.IntersectionExpression() at NPOI.SS.Formula.FormulaParser.UnionExpression() at NPOI.SS.Formula.FormulaParser.Parse() at NPOI.SS.Formula.FormulaParser.Parse(String formula, IFormulaParsingWorkbook workbook, FormulaType formulaType, Int32 sheetIndex, Int32 rowIndex) at NPOI.XSSF.UserModel.XSSFName.set_RefersToFormula(String value)
But when I change to .NET Framework 4.5.1+, they work fine. Could you help me, please? ps: my NPOI version is v2.5.2