Read the excel as a workbook which would output as a datatable .
Datatable.Rows.Count.ToString should give you the total number of rows in the datatable.
or
dtVar.AsEnumerable().Select(Function(x) x(“YourColumnName”).ToString().Trim()).ToArray().Where(Function(y) Not String.IsNullOrEmpty(y)).ToArray().Count.ToString()
Datatable.Rows.Count.ToString should give you the total number of rows in the datatable. This gives the total number of rows in the DT
Try using this :
dtVar.AsEnumerable().Select(Function(x) x(“YourColumnName”).ToString().Trim()).ToArray().Where(Function(y) Not String.IsNullOrEmpty(y)).ToArray().Count.ToString()