PDA

Click to See Complete Forum and Search --> : Excel


hbarker
Jan 5th, 2000, 03:08 AM
I am reading an excel sheet from my Visual Basic application. I want the program to perform until it comes upon an empty cell. The problem is when I use this code

Do While Not objExcel.Range(cbochan1col & rowcnt).Value = Empty

Visual Basic is reading 0's as empty.

Suggestions on how to bypass this so that the program doesn't exit when coming upon a zero?

Aaron Young
Jan 5th, 2000, 04:20 AM
You could try checking the Length of the Text Property, ie.

Do While Len(objExcel.Range(cbochan1col & rowcnt).Text)

------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
ajyoung@pressenter.com

Clunietp
Jan 5th, 2000, 12:43 PM
I don't believe you can access the value of a cell in EXCEL by the TEXT property, it always has to be VALUE.

Maybe evaluate this way:

do while not trim(cstr(objExcel.Range(cbochan1col & rowcnt).Value)) = ""


or Aaron's LEN() funtion suggestion will probably work too

Lyla
Jan 6th, 2000, 03:44 AM
Hi.

Why not include objExcel ISEMPTY() function!

Try it. If it doesn't work let me know.
I have it somewhere.

Good Luck.