Private Sub Command1_Click()
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim PointSheet As Excel.Worksheet
Set xlApp = CreateObject("Excel.Application") '创建EXCEL对象
Set xlBook = xlApp.Workbooks.Open("F:\ABC2.XLS") '打开已经存在的EXCEL工件簿文件
xlApp.Visible = False '设置EXCEL对象不可见
Set PointSheet = xlBook.Worksheets.Item(1) '设置活动工作表
MsgBox "总行数是:" & PointSheet.UsedRange.Rows.Count
xlApp.Quit
Set xlApp = Nothing '"交还控制给Excel
Set xlBook = Nothing
Set PointSheet = Nothing