title: VBA to Click Dropdown Link in IE without Name/ID
body: <p>I'm trying to click a link on a company webpage through VBA. The issue is that the HTML doesn't have a Name or ID. I have seen many different scenarios on this site, and I have been attempting them, but I cannot seem to click this link.</p>
  
  <p>I cannot share the site because it is a company intranet site, but I will share the section of HTML, and my code attempts.</p>
  
  <p>Here is the HTML. It should be known that the link is only accessible by hovering over a menu.</p>
  
  <pre><code> &lt;li title="vendor" class="current"&gt;&lt;a class="sf-with-ul" href="javascript:void(0);"&gt;Vendor A/P Inquiry&lt;span class="sf-sub-indicator"&gt; »&lt;/span&gt;&lt;/a&gt;
    &lt;ul style="width: 7.68em; float: none; display: none; visibility: hidden;"&gt;
     &lt;li title="Vendor Invoice Inquiry Thru Browser" style="width: 100%; float: left; white-space: normal;"&gt;&lt;a style="width: auto; float: none;" href="javascript:top.pageFrame.processSelection('VRJA');"&gt;Vendor A/P Inquiry&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>Here is a screenshot of it, in case it is easier to read this way...
  <a href="https://i.stack.imgur.com/Skgl1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Skgl1.png" alt="HTML Screenshot"></a></p>
  
  <p><strong>EDIT:</strong> The parent item that I would hover over to display the link I need is the line <code>&lt;li title="vendor" class="current"&gt;</code></p>
  
  <p>This is a few of my attempts at clicking this link (which is highlighted blue in the HTML Screenshot)</p>
  
  <p>Attempt 1:</p>
  
  <pre><code> Dim link As Object
              Dim doc As Object
  
              Set doc = ieApp.document
  
              For Each link In doc.Links
              Debug.Print link.innerText
              If link.innerText = "Vendor A/P Inquiry" Then
              link.Click
              Exit For
              End If
              Next link
  </code></pre>
  
  <p>Attempt 2:</p>
  
  <pre><code>  Set ieAnchors = ieApp.document.anchors
                  For Each Anchor In ieAnchors
                      If Anchor.href = "javascript:top.pageFrame.processSelection('VRJA');" Then
                          Anchor.Click
                          Exit For
                      End If
                  Next Anchor
  </code></pre>
  
  <p>Attempt 3:</p>
  
  <pre><code>Set buttonclick = ieApp.document.getElementsByTagName("a")
  For Each element In buttonclick
      If element.href = "javascript:top.pageFrame.processSelection('VRJA');" Then element.Click
  Next element
  </code></pre>
  
  <p>I can navigate the website fine until I get to this link. </p>
  
  <p>Any help would be greatly appreciated, as I feel like I'm going in circles trying the same solutions over and over.</p>