I get the following Exception when I format a large set of columns:
System.OutOfMemoryException: 'Array dimensions exceeded supported range.'
_at System.Collections.Generic.List.setCapacity(Int32 value)
at System.Collections.Generic.List.EnsureCapacity(Int32 min)
at System.Collections.Generic.List.Add(T item)
at CellStore.AddCell(ColumnIndex columnIndex, Int32 pagePos, Int32 pos, Int16 ix, T value)
at CellStore.SetRangeValueSpecial(Int32 fromRow, Int32 fromColumn, Int32 toRow, Int32 toColumn, SetRangeValueDelegate Updater, Object Value)
at OfficeOpenXml.ExcelStyles.SetStyleAddress(StyleBase sender, StyleChangeEventArgs e, ExcelAddressBase address, ExcelWorksheet ws, Dictionary`2& styleCashe)
at OfficeOpenXml.ExcelStyles.PropertyChange(StyleBase sender, StyleChangeEventArgs e)
The code looks something like this. The Exception occurs when i>68.
for (i=0; i<120; i++)
{
format = GetFormat(i);
worksheet.Cells[2, i, 950000, i].Style.Numberformat.Format = format;
}
I get the following Exception when I format a large set of columns: System.OutOfMemoryException: 'Array dimensions exceeded supported range.' _at System.Collections.Generic.List.setCapacity(Int32 value) at System.Collections.Generic.List.EnsureCapacity(Int32 min) at System.Collections.Generic.List.Add(T item) at CellStore.AddCell(ColumnIndex columnIndex, Int32 pagePos, Int32 pos, Int16 ix, T value) at CellStore.SetRangeValueSpecial(Int32 fromRow, Int32 fromColumn, Int32 toRow, Int32 toColumn, SetRangeValueDelegate Updater, Object Value) at OfficeOpenXml.ExcelStyles.SetStyleAddress(StyleBase sender, StyleChangeEventArgs e, ExcelAddressBase address, ExcelWorksheet ws, Dictionary`2& styleCashe) at OfficeOpenXml.ExcelStyles.PropertyChange(StyleBase sender, StyleChangeEventArgs e)
The code looks something like this. The Exception occurs when i>68.