title: VBA - HTML element click
body: <p>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</p>
  
  <p>Here is the HTML code of the element I want to click:</p>
  
  <pre><code>&lt;tr&gt;
  &lt;td height='21'&gt;&lt;/td&gt;
  &lt;td colspan='5'  valign='top' align='left'&gt;
  &lt;DIV id='win0div$ICField28$0'&gt;&lt;table cellpadding='0' cellspacing='0' cols='1'  class = ' ' id='$ICField28$scrolli$0' width='948'&gt;
  &lt;tr&gt;&lt;td&gt;&lt;DIV id='win0divGP$ICField28$0'&gt;&lt;table cellspacing='0' cellpadding='0' border='0' width = '100%'  class='PSLEVEL1SCROLLAREAHEADER'  style = 'border:0'&gt;&lt;tr&gt;&lt;td  class='PSLEVEL1SCROLLAREAHEADER'  align='left' id = 'PSCENTER'&gt;&lt;table class='PSRIGHTCORNER' cellspacing='0' cellpadding='0' border='0' style ='height:100%;' width='100%' &gt;&lt;tr&gt;&lt;td  class='PSLEVEL1SCROLLAREAHEADER PSLEFTCORNER'  style = 'border:0;padding-left:0px;' align='left' &gt;&lt;a name='$ICField28$expand$0' id='$ICField28$expand$0' tabindex='71' href="javascript:submitAction_win0(document.win0,'$ICField28$expand$0');"&gt;&lt;img src='/cs/fsprd/cache/PT_EXPAND_1.gif' alt='Expand section Prepayment Penalty' title='Expand section' border='0' /&gt;&lt;/a&gt;&amp;nbsp;Prepayment Penalty&amp;nbsp;&lt;/td&gt;
  &lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/DIV&gt;&lt;/td&gt;&lt;/tr&gt;
  </code></pre>
  
  <p>I've tried doing many things to click the HTML element such as:</p>
  
  <pre><code>Dim IE as object
  Set IE = CreateObject("InternetExplorer.Application")
  IE.document.getelementsbytagname("img")(0).click
  </code></pre>
  
  <p>but have had no luck.</p>
  
  <p>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.</p>