Skip to content
This repository was archived by the owner on Mar 9, 2020. It is now read-only.
This repository was 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

Description

@lolsoftware

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions