PDA

View Full Version : Calling a function, click a link using VBA



manny123
05-23-2013, 04:17 AM
Hi
I wonder if someone might know this:
I want to get an excel file from an IE page and open it anduse it in excel. The page has a database and allows, by clicking, to “exportdata as excel”.
I am creating an IE object using “CreateObject("InternetExplorer.Application")”
I am facing two problems:
1. I have no idea how to clickthe link. cant see an “ID” so I cant use GetElementByID
2. The click calls a functionand I have no idea how to use vba to get it to work and neither how to get theobject of the workbook it exports
This is the HTML to click (The function is function ExcelBondSearchResults):
<div style="font-weight:bold; border-bottom: 3px solid#95A6B7;">
<span class="exelIcon" onclick="ExcelBondSearchResults()" style="margin-top:-5px">EXPORT</span>
</div>

Many Thanks
Manny