Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VBA identify onmouseover value in web page table

Status
Not open for further replies.

FractalWalk

Technical User
Nov 18, 2002
141
US
I am scraping data from a web page HTMLtable using Excel 2010 VBA and have succesfully captured all of the table cell values. However, for one of the cells, the value is a partial string of the data I need. The actual value is contained in the onmouseover property/event. In other words the web page displays "ABC..." in the cell and I capture that, but when you place the cursor over that cell a tooltip appears showing the full value of "ABCDEFG".

So my question is how can I extract that onmouseover value. I can easily identify the cell in the table, but is there some property I can use to find that value? I tried .onmouseover, but the value returned is null. To complicate matters, the table is created via a script so I can't see it in the source html. I tired listing all of the innertext on every element of the page, but there was no onmouseover listed.

Here is the relevant portion of my code:

Code:
        Set iedoc = IE.Document
        For i = 0 To iedoc.all.Length - 1        
            If TypeName(iedoc.all(i)) = "HTMLTable" Then
                Set IeTable = iedoc.all(i)
                For x = 1 To IeTable.Rows.Length -1
                    For p = 0 To IeTable.Rows(x).Cells.Length - 1
                        Set iecell = IeTable.Rows(x).Cells(p)
                        txt = Trim(iecell.innertext)
                        if p = 2 then
                           txt = 'This is where I would want to identify the value from the onmouseover
                        Endif
                    Next p
                Next x
            End If
        Next i


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top