Gino_Vernisci
New Member
- Joined
- Jul 13, 2011
- Messages
- 20
Hi All
I have written a bit of VBA code that opens an IE web browser, navigates to an online database and inputs the search information. Now I would like to take the results (which are in a table) and put them into the spreadsheet.
My research so far indicates that the best way to do this is is with the "GetElementsByTagName" tool in VBA. My two problems are
1) How do I use "GetElementsByTagName"
2) How do I identify the appropriate tag in the HTML source code
The source code is below. I am certain that this is the bit of code that houses the table of interest to me but I don't know how to find/use the tag.
Any help would be greatly appreciated
Gino
Excel 2007 Windows XP
I have written a bit of VBA code that opens an IE web browser, navigates to an online database and inputs the search information. Now I would like to take the results (which are in a table) and put them into the spreadsheet.
My research so far indicates that the best way to do this is is with the "GetElementsByTagName" tool in VBA. My two problems are
1) How do I use "GetElementsByTagName"
2) How do I identify the appropriate tag in the HTML source code
The source code is below. I am certain that this is the bit of code that houses the table of interest to me but I don't know how to find/use the tag.
Code:
<span class="TableTitle" id="accttabletitle">Search Results from Existing Accounts</span>
<span id="QueryStatus4"> </span>
<table id="Results" border="0" cellpadding="0" cellspacing="0" width="100%">
<thead>
<tr id="tblData" align="left">
<td class="GridHeader" style="width: 25%" align="left">
Account Name</td>
<td class="GridHeader" style="width: 10%" align="left">
State</td>
<td class="GridHeader" style="width: 10%" align="left">
ZipCode</td>
<td class="GridHeader" style="width: 20%" align="left">
Region</td>
<td class="GridHeader" style="width: 20%" align="left">
Market Leader</td>
<td class="GridHeader" style="width: 15%" align="left">
Region Phone</td>
</tr>
</thead>
<tbody id="mytbodycl" name="mytbodycl">
</tbody>
</table>
Any help would be greatly appreciated
Gino
Excel 2007 Windows XP