In code 4.0.4:
if (copyStylesFromRow > 0) { var cseS = new CellsStoreEnumerator<int>(_styles, copyStylesFromRow, 0, copyStylesFromRow, ExcelPackage.MaxColumns);
it uses the value of copyStylesFromRow, but because of the sequence of code, it uses new line numbers. Therefore, if you want to insert 4 lines, starting from line 3:
workbook.Worksheets[1].InsertRow(3,4,6);
Inserts 4 new lines, starting from line 3, because line 3 is included, you must point to the 6th line. This is a mistake, but you can explain it.
source share