2

This is my first time posting a question on StackOverflow. Up until now I have been able to resolve most of my questions via VBA help forums.

My issue is pretty simple. I have an automated data pull in which I need to export data. I have been successful with this in the past, but this one is slightly different.

The HTML for the button I am trying to click to generate the export is this:

  <a id="ReportViewer1_ctl01_ctl05_ctl01" 
    style="font-family: Verdana; font-size: 8pt; color: Gray; text-decoration: none; 
    cursor: default;" href="#" title="Export"
 onmouseout="TextLinkReportViewer1_ctl01_ctl05_ctl01.OnLinkNormal();"
 onmouseover="TextLinkReportViewer1_ctl01_ctl05_ctl01.OnLinkHover();" 
    onclick="if (document.getElementById('ReportViewer1_ctl01_ctl05_ctl00').selectedIndex == 0) return false; 
    if (!ClientToolbarReportViewer1_ctl01.HandleClientSideExport()) __doPostBack('ReportViewer1$ctl01$ctl05$ctl01','');return false;">Export</a>

I have tried several ways to click to no avail.

2
  • I have tried several ways to click to no avail. Please help! <-- What have you tried so far? Commented Oct 2, 2013 at 16:21
  • Any of the below solution worked for you ? Commented Oct 30, 2013 at 19:19

2 Answers 2

2

FireEvent is used to trigger the event attached to any element.

IE.document.getElementById("ReportViewer1_ctl01_ctl05_ctl01").click()
IE.document.getElementById("ReportViewer1_ctl01_ctl05_ctl01").FireEvent("onclick")
Sign up to request clarification or add additional context in comments.

Comments

1
IE.document.getElementById("ReportViewer1_ctl01_ctl05_ctl01").click()

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.