+ Reply to Thread
Results 1 to 6 of 6

Tweaking VBA Code for HTML Table Cell Reading

  1. #1
    Registered User
    Join Date
    05-15-2007
    Posts
    16

    Tweaking VBA Code for HTML Table Cell Reading

    I have a particular Code that isn't working properly. The first time it loops through the instance of IE, it works beautifully. Each succession, not so.

    It's meant for opening an instance of IE, filling out the needed form, and the page returns a table of a staggering number of cells, which must be cycled through until it finds a specific string of text within the cell:

    Please Login or Register  to view this content.
    I 'think' for some reason it's not resetting c in the concurrent loop, but I thought that re-determining "c" as a set number before it goes searching again would have worked. Obviously, this is not going to find the specific text each time it gets to the table to get the next cell's text and return it to my sheet cell. Any ideas?

  2. #2
    Forum Contributor
    Join Date
    06-27-2006
    Posts
    310
    This becomes difficult without the file.
    Looking at this I don't see the variable 'c' as the source of the problem.
    It's not clear to me from reading your post what it is that happens after the first pass, are you saying that you do not get a value entered in the active cell ?


    The reason I ask is I don't see anything within this loop preventing it from exceeding the number of cells in the HTML table.
    Do you generate an error on the second pass ?

    Please Login or Register  to view this content.

    Did you try setting IE to visible so that you could see that the table is coming up properly after the first pass ?
    Last edited by SuitedAces; 02-15-2008 at 01:20 PM.

  3. #3
    Forum Contributor
    Join Date
    06-27-2006
    Posts
    310
    Tell me if I see this correctly

    Please Login or Register  to view this content.
    Are your FormValues in one column ?
    If so don't you need to offset back to that column ?

    Maybe I am reading this wrong but it seems as if you offset to write the value found in the HTML table in the column adjacent to the FormValues and then never offset back to the FormValues column .
    Last edited by SuitedAces; 02-15-2008 at 01:25 PM.

  4. #4
    Forum Contributor
    Join Date
    07-13-2007
    Posts
    151
    Try changing your code near the top to:
    Please Login or Register  to view this content.
    I've found sometimes it is unpredictable when not visible, as nice as it is to not have it flashing around on your screen. Might be worth a try if it gets you the results you need.

  5. #5
    Registered User
    Join Date
    12-07-2009
    Location
    Centreville, VA, USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Tweaking VBA Code for HTML Table Cell Reading

    As you loop through "the part that looks for the specific text in the HTML Table result", it looks like you increment c, but you don't reset the variable "objCell" to recognize that change. This might be your problem.

    Thank you for the post. I'm trying to do something similar, so your code may help me.

  6. #6
    Registered User
    Join Date
    12-07-2009
    Location
    Centreville, VA, USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Tweaking VBA Code for HTML Table Cell Reading

    Oops, I see you did reset objCell. I take back what I said

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1