title: IE VBA How to click on a SVG element
body: <p>My goal is to automate the process that requires going into a certain website, enter a BOL number and then click on search button in order to consult a document.</p>
  
  <p>I haven't been able to click on the search button. </p>
  
  <pre><code>Dim oBrowser As Object
  Dim HTMLdoc As MSHTML.HTMLDocument
  Dim htmlInput As MSHTML.HTMLInputElement
  Dim htmlColl As MSHTML.IHTMLElementCollection
  
  Set oBrowser = CreateObject("InternetExplorer.Application")
  
  With oBrowser
  
  
              'Open Browser
              .navigate "https://www.paquetexpress.com.mx/rastreo-de-envios" 
              .Visible = 1
              Do While .readyState &lt;&gt; 4:
              DoEvents:
              Loop
              Application.Wait (Now + TimeValue("0:00:02"))
  
  
              'Enter BOL Number
              Set HTMLdoc = .document
              Set htmlColl = HTMLdoc.getElementsByTagName("INPUT")
              Do While HTMLdoc.readyState &lt;&gt; "complete": DoEvents: Loop
              For Each htmlInput In htmlColl
                  If htmlInput.Name = "trackingguides" Then
                       htmlInput.Value = "10101010101"
                       Exit For
                  End If
              Next htmlInput
  
  
  '************* I'm having issues with this section **************
  
              'Click Search
              Set HTMLdoc = .document
              Set htmlColl = HTMLdoc.getElementsByTagName("svg")
              x = 1
              Do While HTMLdoc.readyState &lt;&gt; "complete": DoEvents: Loop
  
  
              For Each htmlInput In htmlColl
                      If InStr(1, htmlInput.outerHTML, "0 0 16 16") &gt; 0 Then
                              If htmlInput.offsetTop &gt; 5 Then
                                  htmlInput.Click
                                  Exit For
                              End If
                      End If
              Next htmlInput
  
    '**************************************************************
  End With
  </code></pre>