View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Terry V Terry V is offline
external usenet poster
 
Posts: 34
Default Get a value from a table in an HTML document

Thank you Dick for your replies.
---- If ieDoc.URL Like "http:\\www.myweb.com\*"
This is more of what Im looking for.
If the URL of the webpage is like http://www.domain.com/docname*

within that html document, what does the 564 represent?
What Im attempting to do is : at work, I want to be able to keep track of
clients that call each day, then place them into a worksheet. So that when
I need to do a review of all clients that called back with a repeat
incident, I can track it. When they call in, thier info is placed into a
dynamic html document (maybe php; can't remember) where the fields are all
the same in the generated table and the values are placed in the same
column/cell as the previous or next client info.

So, Im trying to get the Date and email address to be placed into my excel
sheet to prevent me from copy/paste for several hrs at the end of each
period.... then having to manually / visually match the names.

Right now, I have to lookup every client for each day's work to see if they
called back. however, if I can keep track of each person that called, I can
automate a lookup for each name in the list. Saving myself approx 20 hr
work (unpaid) at the end of each month.

Thank you so much
Terry V


Thank you
Terry V



"Dick Kusleika" wrote in message
...
Terry

A Like option on the document? If you know the document title, you can

put
an if statement to test

If ieDoc.Title = "My Web Page"

or you can use a Like there too. If the only way you can identify the
document is by the URL, you can use the URL property

If ieDoc.URL Like "http:\\www.myweb.com\*"

Either of those should go after you make sure ieDoc is an HTMLDocument
object.

If the information you need is a link, you can loop through all the a
objects in the document

For Each ieTbl in ieDoc.Links
If ieTbl.Href Like "mailto: " Then

I don't know of any way to loop through the tables, or to go to a specific
table. If you know what number element the table is, you could do

something
like

ieDoc.all(564).Cells(8).InnerText

but I don't know how you would determine the 564 other than trial and

error.

I hope that answers your questions, but be sure to post back if not.

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"Terry V" wrote in message
...
Dick
Hey this is really cool.
When I use this app, I will always have approximately 18 HTML documents

open
at the same time.

Is there a way to add a "Like" option? I know what the first part of

the
url is going to be each time, and I know what cell it will be in (the

info
I
need, is an email address). I think I can figure out what table on the

page
it will be in, because it will be in the same cell on the same table

every
time. The only thing that actually changes, is the information that is
displayed in the tables -- everything else is the same.


Thank you so much
Terry V
"Dick Kusleika" wrote in

message
...
Terry

You can try something like this. Tools - Reference - Microsoft

Internet
Controls. Then loop through the ShellWindows until you find an
HTMLDocument. Then loop through all the elements and test every

HTMLTable
until you find the one you need. There's probably a more efficient

way
to
do this, but it's the only way I know. Here's an example using
http://www.dicks-blog.com/excel/2004...end_picks.html

Sub GetTableCell()

Dim ieApp As Object
Dim ieTbl As Object
Dim sws As SHDocVw.ShellWindows
Dim ieDoc As Object

Set sws = New SHDocVw.ShellWindows

For Each ieApp In sws
Set ieDoc = ieApp.Document

If TypeName(ieDoc) = "HTMLDocument" Then
For Each ieTbl In ieDoc.all
If TypeName(ieTbl) = "HTMLTable" Then
If ieTbl.Cells(0).innertext = "BYU" Then
Debug.Print ieTbl.Cells(10).innertext
End If
End If
Next ieTbl
Exit For
End If
Next ieApp

Set ieApp = Nothing

End Sub

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"Terry V" wrote in message
...
Hello
I need to be able to access information that is in an HTML document

(in
a
table), from an application that will be opened. (Although the

application
is a webpage, it is dynamic in content). I need to be able to

access
a
particular cell (the same one every time) in this table and place

its
value
in an access cell.

Using the xlUp, I can place it as the next item in the column, but I
cannot
seem to figure out how to get the value to begin with.

I believe it was on Jwalk that I saw the function/sub to open a

webpage,
but
I don't need to open it, only get a value from an open page.

Any suggestions?

Thank you so much
Terry V