I have an .xlsx file with 3 columns SrNumber,Name,Active in A,B and C columns respectively.
I am reading the content of this file in a DataTable using the source code given in the answer of following question
From Excel to DataTable in C# with Open XML
I have also did the modificaitons suggested by Sourabh
It works fine when my content is as follows
A B C
1 SrNumber Name Active
2 1 test1 Yes
3 2 test2 Yes
4 3 test3 Yes
5 4 test4 Yes
Now when I am trying to add a row at 6th position I am entering the data only in B6 and C6 cells. I have not touched A6 Cell.
After running that code I am getting my DataTable filled as follows
You can see that value entered in B6 coming in first column and value entered in C6 coming in second column.
Also row.Descendants<Cell>()
returning only 2 cells for the newly entered row.
Please let me know if any modifications to be done in the source code.