EOF of excel in vb6

Posted by Mark on Stack Overflow See other posts from Stack Overflow or by Mark
Published on 2010-03-16T06:43:58Z Indexed on 2010/03/16 6:46 UTC
Read the original article Hit count: 294

Filed under:
|
|

how do i write the code in vb6 in finding the EOF of excel file

can anyone help me?

i try to code this and it works..

--->

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

<---

this code is working, but the only problem is only the column 1 will be checked and the others is not. Can anyone help me on how to improve this code to check all rows and column of excel cells.

© Stack Overflow or respective owner

Related posts about eof

Related posts about excel