There are various ways to solve your problem, the easiest I can think of is read range for the entire sheet and find first empty cell then you'll have all the things you need in the data table and manipulate it as you like. This method is very inefficient but easy to implement.
Another way you could deal with this is by invoking VBA, you can do it something like this :
Function GetRowCount()
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("Sheet1")
Dim k As Long
k = sh.Range("A1", sh.Range("A1").End(xlDown)).Rows.Count
GetRowCount = k
End function
This should work just fine, but it requires you to use an Excel scope (and this requires you to have Excel installed).
hope this helped