Quantcast
Channel: EPPlus Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 2262

Commented Unassigned: ExcelRange.Value = null; throws an exception [15402]

$
0
0
Please find attached a sample application which opens a workbook and sets cell values to null. The workbook is inside the attachment ( ConsoleApplication1\bin\Debug\in.xlsx ).

The error message is:
Specified argument was out of the range of valid values.
Parameter name: Start cell Address must be less or equal to End cell address
at OfficeOpenXml.ExcelAddressBase.Validate()
at OfficeOpenXml.ExcelAddressBase.SetAddress(String address)
at OfficeOpenXml.ExcelAddress.set_Address(String value)
at OfficeOpenXml.ExcelRange.get_Item(String Address)
at OfficeOpenXml.ExcelRangeBase.SplitFormula(ExcelAddressBase address, Int32 ix)
at OfficeOpenXml.ExcelRangeBase.SplitFormulas(ExcelAddressBase address)
at OfficeOpenXml.ExcelRangeBase.Set_Value(Object value, Int32 row, Int32 col)
at OfficeOpenXml.ExcelRangeBase.SetValueAddress(ExcelAddress address, _setValue valueMethod, Object value)
at OfficeOpenXml.ExcelRangeBase.SetRange(_setValue valueMethod, Object value)
at OfficeOpenXml.ExcelRangeBase.set_Value(Object value)
Comments: The issue is in file "ExcelRangeBase.cs" in function "private void SplitFormulas(ExcelAddressBase address)": ``` //Bottom Range if (fRange._toRow > address._toRow) { if (fIsSet) { f = new ExcelWorksheet.Formulas(SourceCodeTokenizer.Default); f.Index = _worksheet.GetMaxShareFunctionIndex(false); f.IsArray = false; _worksheet._sharedFormulas.Add(f.Index, f); } f.StartCol = fRange._fromCol; f.StartRow = _toRow + 1; // THIS LINE IS BUGGY ``` has to be ``` //Bottom Range if (fRange._toRow > address._toRow) { if (fIsSet) { f = new ExcelWorksheet.Formulas(SourceCodeTokenizer.Default); f.Index = _worksheet.GetMaxShareFunctionIndex(false); f.IsArray = false; _worksheet._sharedFormulas.Add(f.Index, f); } f.StartCol = fRange._fromCol; f.StartRow = address._toRow + 1; // THIS FIXES THE CRASH ```

Viewing all articles
Browse latest Browse all 2262

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>