用VBA打开一个网页 [英] open a web page with VBA

查看:181
本文介绍了用VBA打开一个网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从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

地址:=" http:// www。 rondebruin.nl/Google.htm "

结束子

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

推荐答案

嗨Caroline,

Hi Caroline,

感谢您在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 to Visual Basic for Applications (VBA) for better support.

感谢您的理解。

致以最诚挚的问候,


这篇关于用VBA打开一个网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆