This project has moved and is read-only. For the latest updates, please go here.

Inserting Rows

Jan 21, 2012 at 5:14 PM
Edited Jan 21, 2012 at 5:15 PM

Hi,

I am trying to insert some rows into a specific range, but getting an error as follows..

Specified argument was out of the range of valid values.Parameter name: The cells CRO11 and CRO11048576 are outside the range ''Statement of Account- DeCr'!A1:XFD1048576'.

 

Here is the code I am using 

 

var wb = new ClosedXML.Excel.XLWorkbook("E_Retail_Statement_Format.xlsx");
            var ws = wb.Worksheet("Statement of Account- DeCr");
ws.Range("A20:H20").InsertRowsBelow(1);
wb.SaveAs("InsertingRows.xlsx");

 

Error is getting while executing the InsertRowsBelow method. The source spreadsheet is formatted file. Here is the download link for the source spreadsheet file. 

https://www.yousendit.com/download/T2djc2ZNTkxnYU9LRmNUQw

 

It would be great if someone can help...

Thanks,

Sree

Jan 21, 2012 at 5:33 PM

This has been fixed. I'm wrapping up a few things before the next release though.

In the meantime you could pick up the latest source code.

Jan 22, 2012 at 5:25 AM

Great! Its working.. thanks a lot for the quick fix..