title: Clicking on a javascript <span> element with VBA
body: <p>This is on a private website so I cannot paste the entire code or link.
  I know the span # is 41 but I cannot click Export to CSV.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;SPAN onclick="function onclick(event) { ur_Button_click(event); }" class=urBtnRow&gt;
  &lt;A onclick=ur_Button_click(event); tabIndex=0 id=BUTTON_TOOLBAR_2_btn3_acButton title="Export to CSV" class=urBtnStd onkeydown=ur_Button_keypress(event); style="OVERFLOW: visible; TEXT-ALIGN: center" href="javascript:void(0);" ct="B" ocl="sapbi_page.sendCommandArray([['GUID','8',0],['NOUILOCK','X',0],['BI_COMMAND_TYPE','ABSTRACT',0]],event);" ti="0" st=""&gt;Export to CSV&lt;/A&gt;&lt;/SPAN&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>When I run the below code in VBA the Message box will come up and say Export to CSV but no matter what I try I cannot click on it!</p>
  
  <p>I am a newbie when it comes to this.</p>
  
  <pre><code>With ie
      For i5 = 0 To .document.frames(0).document.all.tags("SPAN").Length - 1
          With .document.frames(0).document.all.tags("SPAN").Item(i5)
              If InStr(.innerText, "Export to CSV") &gt; 0 Then
                  MsgBox .innerText, vbInformation
  </code></pre>
  
  <p>I have tried:</p>
  
  <pre><code>.Click
  .onclick = "function onclick(event) { ur_Button_click(event); }"
  .onclick
  .Parentelement.click
  .Fireevent ("onclick")
  .focus.click
  .execScript (onclick)
  </code></pre>
  
  <p>The i5 value is 41 and it will always be the same.</p>