VBA onclick 事件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15941493/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 20:33:26 来源:igfitidea点击:
VBA onclick event
提问by user2268910
<a href="#" onclick="show('11635356');">11635356</a>
The above HTML code shows the number 11635356 as a link on the web page. I want to click on this link. How to link to this page using Visual Basic for Excel?
上面的 HTML 代码将数字 11635356 显示为网页上的链接。我想点击这个链接。如何使用 Visual Basic for Excel 链接到此页面?
回答by Santosh
Try below code.
试试下面的代码。
Set ancElem = IE.document.getelementsbytagname("a")
ancElem.Click
OR
或者
Document.GetElementsByTagName("a").Item(0).FireEvent("click()")