title: How to code with excel vba to click a button on website that has no id, name, or class?
body: <p>Here is the html for the button:</p>
  
  <pre><code>&lt;div style = "position:absolute;top:2px;left:5px;"&gt; == $0  
    &lt;button title = "Start New Quote" style = "background-color: 
    rgb(4,61,111);   
    color:rgb(255,255,255); width:122px;height:33px;padding-  
    left:0px;padding-right:0px;font-size:12px;font-weight:bold;" onclick = 
    toggleNewBusinessMenu();   
    return false;"&gt; == $0    
      &lt;img style = "vertical-align: middle" src =  
        "/images/icons/create_quote.png"&gt; == $0  
        "&amp;nbsp;&amp;nbspStart Quote&amp;nbsp  
               "
   &lt;/button&gt;  
   &lt;/div&gt;  
  </code></pre>
  
  <p>Here is one option I've tried but new at coding so not sure how its supposed to work with no name or id:</p>
  
  <pre><code>Sub Superior()
  Dim ieApp As Object
  
  'create a new instance of ie
  Set ieApp = CreateObject("InternetExplorer.Application")
  ieApp.Visible = True
  
  ieApp.navigate "website"
  
  Wait 1
  Do While ieApp.Busy: DoEvents: Loop
  Do Until ieApp.readyState = READYSTATE_COMPLETE: DoEvents: Loop
  
  ieApp.document.all("login_email").Value = "username"
  ieApp.document.all("login_password").Value = "password"
  ieApp.document.all("login_button").Click
  
  Wait 1
  Do While ieApp.Busy: DoEvents: Loop
  Do Until ieApp.readyState = READYSTATE_COMPLETE: DoEvents: Loop
  
  ieApp.document.getElementsByTagName("$0").Click
  
  End Sub
  
  Sub Wait(Seconds)
      CreateObject("WScript.Shell").Run "%COMSPEC% /c ping 127.0.0.1 -n " _
      &amp; Seconds + 1, 0, True
  End Sub
  </code></pre>
  
  <p>I have tried everything - thanks!  </p>