要使用VBS获取电子表格中A列最后一个单元格所在的行数,可以使用以下代码:
```vbs
Option Explicit
Dim objExcel, objWorkbook, objWorksheet, lastRow
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\path\to\your\excel\file.xlsx")
Set objWorksheet = objWorkbook.Worksheets(1)
lastRow = objWorksheet.Cells(objWorksheet.Rows.Count, "A").End(-4162).Row
MsgBox "A列最后一个单元格所在的行数为:" & lastRow
objWorkbook.Close SaveChanges:=False
objExcel.Quit
Set objWorksheet = Nothing
Set objWorkbook = Nothing
Set objExcel = Nothing
```
请将`C:\path\to\your\excel\file.xlsx`替换为您的电子表格文件的实际路径。运行此脚本后,将弹出一个消息框显示A列最后一个单元格所在的行数。
```vbs
Option Explicit
Dim objExcel, objWorkbook, objWorksheet, lastRow
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\path\to\your\excel\file.xlsx")
Set objWorksheet = objWorkbook.Worksheets(1)
lastRow = objWorksheet.Cells(objWorksheet.Rows.Count, "A").End(-4162).Row
MsgBox "A列最后一个单元格所在的行数为:" & lastRow
objWorkbook.Close SaveChanges:=False
objExcel.Quit
Set objWorksheet = Nothing
Set objWorkbook = Nothing
Set objExcel = Nothing
```
请将`C:\path\to\your\excel\file.xlsx`替换为您的电子表格文件的实际路径。运行此脚本后,将弹出一个消息框显示A列最后一个单元格所在的行数。