如何使用 VBA 刷新 IE
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8679665/
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
How to refresh IE using VBA
提问by Hazior
I have been trying to figure out a way to refresh internest explorer through VBA. I have a webpage I need to refresh periodicly and I need VBA or something to refresh it. Do you guys know of a way to get VBA to refresh a webpage?
我一直在想办法通过 VBA 来刷新兴趣浏览器。我有一个需要定期刷新的网页,我需要 VBA 或其他东西来刷新它。你们知道让VBA刷新网页的方法吗?
采纳答案by Justin Self
To use this code which applies Early Bindingyou will need to add a reference to "Microsoft Internet Controls" in the Visual Basic Editor
要使用此应用早期绑定的代码,您需要在 Visual Basic 编辑器中添加对“Microsoft Internet Controls”的引用
This code will open IE, go to google, wait for the page to load completely, then refresh.
此代码将打开 IE,转到 google,等待页面完全加载,然后刷新。
Sub RefreshPage()
Dim page As New InternetExplorer
page.Navigate "www.google.com"
page.Visible = True
Do
Loop Until page.ReadyState = READYSTATE_COMPLETE
page.Refresh
End Sub