I have an excel file that has a table with range A:K and has few rows say 100. So the cells with A1..K100 has values. But the same sheet has values at some random cells like Q6000. The file was of 47KB. Now I do
```
var excelTable = wb.Worksheets.First().Tables.FirstOrDefault(t => string.Equals("Table", t.Name, StringComparison.Ordinal));
var row = excelTable.DataRange.InsertRowsBelow(1).First();
```
The excel file after the insertion grew to 270KB. When checked, I saw new cells added all through A101..Q6001 in the sheet.xml which is incorrect. Also, when we insert one row, all the cells below the new row gets pushed down by one row. Here only the cell columns that are part of table are considered which is incorrect. It should consider the MaxColumnUsed.
There are two issues
1. XLRangeAddress.InsertRowsAboveInternal() should not add new cells for old cells that are not present in the internal worksheet.
2. XLRangeAddress.InsertRowsAboveInternal() should use MaxColumnUsed when it is pushing the cell values down by number of rows being inserted.
The issue 1 is affecting the performance because saving big files to stream takes lot of time.
The issue 2 causes inconsistency after insertion
Comments: A small correction please. Both issues exist in __XLRangeBase.InsertRowsAboveInternal()__
```
var excelTable = wb.Worksheets.First().Tables.FirstOrDefault(t => string.Equals("Table", t.Name, StringComparison.Ordinal));
var row = excelTable.DataRange.InsertRowsBelow(1).First();
```
The excel file after the insertion grew to 270KB. When checked, I saw new cells added all through A101..Q6001 in the sheet.xml which is incorrect. Also, when we insert one row, all the cells below the new row gets pushed down by one row. Here only the cell columns that are part of table are considered which is incorrect. It should consider the MaxColumnUsed.
There are two issues
1. XLRangeAddress.InsertRowsAboveInternal() should not add new cells for old cells that are not present in the internal worksheet.
2. XLRangeAddress.InsertRowsAboveInternal() should use MaxColumnUsed when it is pushing the cell values down by number of rows being inserted.
The issue 1 is affecting the performance because saving big files to stream takes lot of time.
The issue 2 causes inconsistency after insertion
Comments: A small correction please. Both issues exist in __XLRangeBase.InsertRowsAboveInternal()__