EPPlus icon indicating copy to clipboard operation
EPPlus copied to clipboard

InsertColumns updates Comment cell address but does not reparent the comment

Open Prinsn opened this issue 5 years ago • 0 comments

Inserting a column appears to parent comment objects to the new column while updating the cell address to the new column.

This leads to an inability to delete the comment by address, or delete the column.

            ws.Cells["A1"].AddComment("na", "test");
            ws.InsertColumn(1, 1);
            Log(ws.Cells["A1"].Comment.Address); // => "B1"
              
            //Throws a null reference exception
            ws.Comments.Remove(ws.Cells["B1"].Comment);

            //Throws an exception "Comment does not exist"
            ws.DeleteColumn(2);

Prinsn avatar Dec 18 '19 15:12 Prinsn