1) Enter the VBA
- Enable the developer mode
- Open the VBA or press Alt+F11
2) Add Userform
In the Projects window, right-click and Enter a Userform
3) Insert Web Browser
Inside Userform, insert Browser.
- Click on
Ferramentas
and then Controles adicionais...
- Or right click on the Toolbox
- Within
Controles Adicionais...
, enable Microsoft Web Browser
. With this the photo of a planet will be inserted in the Toolbox
- Insert Web Browser into Userform by clicking on the planet.
4)Insert Textbox
Click the image toolbox button and enter the Textbox
5)Insert Button
Click on the image button and insert a rotary pushbutton.
6)Code
- Click to View Userform Code
Enter the code.
Private Sub CommandButton1_Click()
Dim web_link As String
web_link = TextBox1
Me.WebBrowser1.Navigate web_link
End Sub
7)Result
Userform can be improved, for example by opening a window that is resized to the entire screen. And to call the Userform, just add some button, for this there are several tutorials.
Note: If the Web Browser does not work, read this link to enable it. Remember that it was disabled from Excel 2013 or higher, to improve security.
Tail this Tutorial in English, use the translator if necessary.
– danieltakeshi
If your Excel is bigger than 2013, read this, where Microsoft has disabled this option for security reasons. But if you still want to take risks, take the link steps.
– danieltakeshi
This way I already tried but the bar does not appear to insert a URL. I wanted to insert a URL in some bar or cell and automatically display the WEB page next to it. It is possible?
– Thiago
Yes, instead of
Me.WebBrowser1.Navigate "http://www.google.com"
, you use a variable instead of google.com and insert the values as Textbox in userform and use some button to start.– danieltakeshi
I have no idea how to do this. Give me an example for kindness?
– Thiago