如何在 vb6 中编写代码来查找 Excel 文件的 EOF?
Dim excelApp as Excel.Application
Dim excelWB as Excel.Workbook
Set excelApp = New Excel.Application
Set excelWB = excelApp.Workbooks.Open("D:\Book1.xls")
Dim xlsRow as Long
Dim EOF as Boolean
xlsRow = 1
Do While (EOF = False)
If (excelWB.Sheets("Sheet1").Cells(xlsRow, 1).Value = "") Then
EOF = True
Else
xlsRow = xlsRow + 1
End If
Loop
这段代码有效,但唯一的问题是只有第 1 列会被检查,而其他的则不会。谁能帮助我改进此代码以检查 Excel 单元格的所有行和列?