Skip to content
This repository has been archived by the owner on Mar 9, 2020. It is now read-only.

"Start cell Address must be less or equal to End cell address" Exception #627

Open
lolsoftware opened this issue Feb 22, 2020 · 0 comments

Comments

@lolsoftware
Copy link

I am getting the "Start cell Address must be less or equal to End cell address" Exception when trying to set a value for a cell range.

using (var excelPackage = new ExcelPackage(fs))
{
var ws = excelPackage.Workbook.Worksheets["Data"];
ws.Cells[2, 1, 4001, 17].Value = null;

excelPackage.Save();

}

Please find attached the input Excel file along with the source code to help you replicate the issue
input.xlsx
Program.zip

Stack trace:
at OfficeOpenXml.ExcelAddressBase.Validate() in ExcelAddress.cs
at OfficeOpenXml.ExcelAddressBase.SetAddress(String address) in ExcelAddress.cs
at OfficeOpenXml.ExcelAddress.set_Address(String value) in ExcelAddress.cs
at OfficeOpenXml.ExcelRange.get_Item(String Address) in ExcelRange.cs
at OfficeOpenXml.ExcelRangeBase.SplitFormula(ExcelAddressBase address, Int32 ix) in ExcelRangeBase.cs
at OfficeOpenXml.ExcelRangeBase.SplitFormulas(ExcelAddressBase address) in ExcelRangeBase.cs
at OfficeOpenXml.ExcelRangeBase.Set_Value(ExcelRangeBase range, Object value, Int32 row, Int32 col) in ExcelRangeBase.cs
at OfficeOpenXml.ExcelRangeBase.SetValueAddress(ExcelAddress address, _setValue valueMethod, Object value) in ExcelRangeBase.cs
at OfficeOpenXml.ExcelRangeBase.SetRange(ExcelRangeBase range, _setValue valueMethod, Object value) in ExcelRangeBase.cs
at OfficeOpenXml.ExcelRangeBase.set_Value(Object value) in ExcelRangeBase.cs

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant