问题描述
我正在尝试从Excel菜单中打开网页。我在网上找到了2个封闭的代码。但它们都有以下问题:
I am trying to open a web page from an excel menu. I have found the 2 enclosed pieces of code on the web. But they both have the following problem:
- 它们打开资源管理器而不是默认浏览器
- they open Explorer and not the default browser
- Microsoft在打开Web浏览器之前显示警告消息(针对潜在的病毒等),如果单击"确定",那很好。但是,如果你点击取消,你会收到一个VBA错误。
- Microsoft displays a warning messages before opening the web browser (against potential virus, etc), if you click OK, fine. But if you click cancel, you get a VBA error.
任何帮助都像往常一样非常受欢迎。
Any help really appreciated as usual.
谢谢
Caroline
Sub LoadWebPage()
ActiveWorkbook.FollowHyperlink
地址:=" "
结束子
或
Sub CallWebPage()
ActiveWorkbook.FollowHyperlink _
Address:=" http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=225018&SiteID=1 ",
_
NewWindow:= True,_
AddHistory:= True
Application.WindowState = xlNormal
End Sub
推荐答案
感谢您在MSDN论坛上发帖。
Thank you for posting in the MSDN Forum.
由于您主要关注的是使用VBA语言而不是Excel对象模型,我会将您的主题移至
Visual Basic for Applications(VBA)以获得更好的支持。
Since your major concern is more related to using VBA language than Excel Object models, I'll move your thread toVisual Basic for Applications (VBA) for better support.
感谢您的理解。
致以最诚挚的问候,
这篇关于用VBA打开一个网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!