Results 1 to 4 of 4

Thread: Excel

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 1999
    Location
    St. Louis, MO USA
    Posts
    21

    Post

    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?

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    You could try checking the Length of the Text Property, ie.

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

    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]


  3. #3
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    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


  4. #4
    Addicted Member
    Join Date
    Jul 1999
    Location
    Portland, OR.
    Posts
    226

    Post

    Hi.

    Why not include objExcel ISEMPTY() function!

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

    Good Luck.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width