vba 我可以/如何以 excel 表格显示网页?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21859096/
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
Can I/How do I show a webpage in an excel form?
提问by cquadrini
I making a spreed sheet to evaluate user experience of a web page. I am wondering, can I have the user open a workbook, have a form pop-up show a webpage in one portion and have questions in another portion. The webpage has to be active and not an image. If it is doable, can I be provided direction in terms of another post or website? Thank you.
我制作了一个电子表格来评估网页的用户体验。我想知道,我可以让用户打开一个工作簿,让一个表单弹出窗口在一个部分显示网页并在另一部分有问题。网页必须是活动的,而不是图像。如果可行,是否可以在其他帖子或网站方面为我提供指导?谢谢你。
回答by Jerome Montino
It is possible. You should use the WebBrowser
control in your Userform
.
有可能的。您应该WebBrowser
在Userform
.
In the VBE, go to Tools
, then Additional Controls
. Enable Microsoft Web Browser
.
在 VBE 中,转到Tools
,然后Additional Controls
。启用Microsoft Web Browser
。
A new icon in your Toolbox
should show up. It's the WebBrowser
control. Add it to your userform.
Toolbox
应该会出现一个新图标。这是WebBrowser
控制。将其添加到您的用户表单中。
Code is up to you. Sample follows:
代码由您决定。示例如下:
Private Sub UserForm_Initialize()
Me.WebBrowser1.Navigate "http://www.google.com"
End Sub
The above code navigates the control to Google when you start up the userform, like so:
当您启动用户表单时,上面的代码将控件导航到 Google,如下所示:
Hope this helps.
希望这可以帮助。
回答by Tarik
Use the WebBrowser ActiveX control. See http://msdn.microsoft.com/en-us/library/aa752043(v=vs.85).aspx
使用 WebBrowser ActiveX 控件。请参阅http://msdn.microsoft.com/en-us/library/aa752043(v=vs.85).aspx