MS Excel - Подсчёт заполненных строк в листе
Dim objExcelApp As Object
Dim objWorkbook As Object
Dim objWorksheet As Object
Dim strPath As String
strPath = "d:\Downloads\Book1.xlsx"
Set objExcelApp = CreateObject("Excel.Application")
Set objWorkbook = objExcelApp.Workbooks.Open(strPath)
Set objWorksheet = objWorkbook.Worksheets(1)
Debug.Print objWorksheet.usedrange.rows.Count
On Error Resume Next
objWorkbook.Close
Set objWorkbook = Nothing
objExcelApp.Quit
Set objExcelApp = Nothing
Err.Clear