Technology Microsoft Software & solutions

How to Open a Website With VBA

    • 1). Open the Microsoft Excel application from the "Start" button located on the Windows menu bar.

    • 2). Open the macro menu by pressing the "Alt" and "F8" keys.

    • 3). Enter "Browser" into the Macro name box and click on the "Create" button.

    • 4). Paste the following code directly below the text "Browser":

      Dim urlData As String
      Set Browser = CreateObject("InternetExplorer.Application")
      urlData = InputBox("Please enter URL")
      Browser.Navigate (urlData)
      Browser.Visible = True

    • 5). Save the macro by pressing the "Ctrl" and "S" keys. Close the window titled "Microsoft Visual Basic" to return to the Excel application.

    • 6). Open the macro menu by pressing the "Alt" and "F8" keys. Select the macro "Browser" and click on the button labeled "Run."

    • 7). Enter the website to which you wish to navigate in the pop up box with the text "Please enter URL." Click on the button labeled "OK" and the website will display in a new Internet Explorer browser.



Leave a reply