View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Maxi[_2_] Maxi[_2_] is offline
external usenet poster
 
Posts: 94
Default browser integration

Tim helped me with a code to open browser through vba and navigate a
website. Code given below. However, I have two questions.

Sub foo()

Dim IE As Object

Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate Range("A1").Value
Do While IE.ReadyState < 4
DoEvents
Loop

With IE.document.all
.Uname.Value = "myUsername"
.Pass.Value = "myPassword"
.Submit.Click
End With

Do While IE.ReadyState < 4
DoEvents
Loop

End Sub

Question1: If the webpage has a table and I want to look up data from
those tables then how do I find that out?

For instance: In the webpage I have lots of tables and in one of the
table which is of size 4X2 (4 rows and 2 columns). On the left side
there will be headings and on the right side a dynamic value.

Example
Report Owner: Maxi
Sent by: Tom
Sent to: Dick
Verified by: Harry

Somewhere down the code, I need a code that will check the Report
Owner, Sent by, Sent to, and Verified by and update it in cells B1 C1
D1 and E1. I have all my links in column A1:A25. I don't want to use a
web query because I have 25 links to loop through (mywebsite.com/
page1.htm, mywebsite.com/page2.htm .... page25.htm)

Here is the html code of the table

<table class="myPanel" border="0" cellpadding="2" cellspacing="0"
width="100%"
<tr class="row1"
<td class="rowLabel"Report Owner:</td
<td valign="top"Maxi</td
</tr
<tr class="row0"
<td class="rowLabel"Sent by:</td
<td<bTom</b</td
</tr
<tr class="row1"
<td class="rowLabel"Sent to:</td
<tdDick</td
</tr
<tr class="row0"
<td class="rowLabel"Verfied by:</td
<tdHarry </td
</tr
</table

I have read articles which says you can get it by getElementByID but
for that I need <table id="some name" but in my html code, there is no
"id", it says <table class="myPanel". Here I am getting confused.

Question1:
There will be an hyperlink on all pages that says "take me here" how
can I click on that website programatically?

Need help

Thank you
Maxi