Well, I am not completely sure about your query/issue. Do you need to get total number of rows? If this is the case, you may use Cells.MaxRow and Cells.RowsCount attributes accordingly. And, to add/insert rows, you may use Cells.InsertRow/Cells.InsertRows method(s). See the document for your reference: