这是我第一次在 StackOverflow 上发布问题。到目前为止,我已经能够通过 VBA 帮助论坛解决我的大部分问题。
我的问题很简单。我有一个自动数据拉取,我需要在其中导出数据。我过去曾在这方面取得过成功,但这次略有不同。
我尝试单击以生成导出的按钮的 HTML 如下:
<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>
我尝试了多种方法点击都没有效果。
FireEvent 用于触发附加到任何元素的事件。
IE.document.getElementById("ReportViewer1_ctl01_ctl05_ctl01").click()
IE.document.getElementById("ReportViewer1_ctl01_ctl05_ctl01").FireEvent("onclick")
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)