I am trying to click on an HTML drop-down menu in IE from VBA. Right now, I'm actually using Sendkeys "{Tab}" over 21 times to get to the element, and then I Sendkeys "{Enter}" to get the drop-down. Obviously, this is a horrible solution, but I can't seem to get anything else to work
Here is the HTML code of the element I want to click:
<tr>
<td height='21'></td>
<td colspan='5' valign='top' align='left'>
<DIV id='win0div$ICField28$0'><table cellpadding='0' cellspacing='0' cols='1' class = ' ' id='$ICField28$scrolli$0' width='948'>
<tr><td><DIV id='win0divGP$ICField28$0'><table cellspacing='0' cellpadding='0' border='0' width = '100%' class='PSLEVEL1SCROLLAREAHEADER' style = 'border:0'><tr><td class='PSLEVEL1SCROLLAREAHEADER' align='left' id = 'PSCENTER'><table class='PSRIGHTCORNER' cellspacing='0' cellpadding='0' border='0' style ='height:100%;' width='100%' ><tr><td class='PSLEVEL1SCROLLAREAHEADER PSLEFTCORNER' style = 'border:0;padding-left:0px;' align='left' ><a name='$ICField28$expand$0' id='$ICField28$expand$0' tabindex='71' href="javascript:submitAction_win0(document.win0,'$ICField28$expand$0');"><img src='/cs/fsprd/cache/PT_EXPAND_1.gif' alt='Expand section Prepayment Penalty' title='Expand section' border='0' /></a> Prepayment Penalty </td>
</tr></table></td></tr></table></DIV></td></tr>
I've tried doing many things to click the HTML element such as:
Dim IE as object
Set IE = CreateObject("InternetExplorer.Application")
IE.document.getelementsbytagname("img")(0).click
but have had no luck.
Does anyone have any ideas of what I could do to click this drop-down? Please let me know if I can provide more information.