Web data query in Excel

Asked

Viewed 956 times

0

work in a company and need to monitor the lifetime of printer toners daily...

For this I created a monitoring spreadsheet, only I wanted a practical system, like this:

When I insert the web address into a cell of the spreadsheet, automatically on the side appear the web page... This is to avoid going into the browser, looking, and then entering the percentage. But I wanted like a frame inside the spreadsheet. For example: I put the address "google.com" in cell A7, then automatically on the side appeared the page display. It is possible

  • Tail this Tutorial in English, use the translator if necessary.

  • 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.

  • 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?

  • 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.

  • I have no idea how to do this. Give me an example for kindness?

1 answer

0


1) Enter the VBA

  1. Enable the developer mode
  2. Open the VBA or press Alt+F11

2) Add Userform

In the Projects window, right-click and Enter a Userform

![Inserir Userform

3) Insert Web Browser

Inside Userform, insert Browser.

  1. Click on Ferramentas and then Controles adicionais... Controles adicionais...
  2. Or right click on the Toolbox Controles adicionais...
  3. Within Controles Adicionais..., enable Microsoft Web Browser. With this the photo of a planet will be inserted in the Toolbox Microsoft Web Browser
  4. Insert Web Browser into Userform by clicking on the planet. Inserir Web Browser

4)Insert Textbox

Click the image toolbox button and enter the Textbox

TextBox

5)Insert Button

Click on the image button and insert a rotary pushbutton.

Botão

6)Code

  1. Click to View Userform Code

Exibir código

  1. Enter the code.

    Private Sub CommandButton1_Click()
    Dim web_link As String
    
        web_link = TextBox1
        Me.WebBrowser1.Navigate web_link
    End Sub
    

7)Result

Resultado

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.

  • Perfect! Thank you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.