This project has moved. For the latest updates, please go here.
1

Closed

NullReferenceException on InsertRowsBelow() after CopyTo()

description

Found NullReferenceException when trying insert rows into copied sheet.
    class Program
    {
        static void Main(string[] args)
        {
            XLWorkbook wbk = new XLWorkbook(@"C:\MySheet.xlsx");
            IXLWorksheets shts = wbk.Worksheets;
            IXLWorksheet sht = shts.First();
            sht.CopyTo("new_sheet");
            sht = shts.Last();
            sht.Row(1).InsertRowsBelow(1);
            wbk.Save();
        }
Closed Apr 25 at 8:39 PM by igitur
Please try the latest version of ClosedXML (v0.87.1 at this stage). If you still experience the issue, log it on the new GitHub page.

comments

MDeLeon wrote Jan 23, 2013 at 8:55 PM

Attach the file