Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 906267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:21:36+00:00 2026-05-15T16:21:36+00:00

How do I open an HTML page in the default browser with VBA? I

  • 0

How do I open an HTML page in the default browser with VBA? I know it’s something like:

Shell "http://myHtmlPage.com"

But I think I have to reference the program which will open the page.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T16:21:37+00:00Added an answer on May 15, 2026 at 4:21 pm

    You can use the Windows API function ShellExecute to do so:

    Option Explicit
    
    Private Declare Function ShellExecute _
      Lib "shell32.dll" Alias "ShellExecuteA" ( _
      ByVal hWnd As Long, _
      ByVal Operation As String, _
      ByVal Filename As String, _
      Optional ByVal Parameters As String, _
      Optional ByVal Directory As String, _
      Optional ByVal WindowStyle As Long = vbMinimizedFocus _
      ) As Long
    
    Public Sub OpenUrl()
    
        Dim lSuccess As Long
        lSuccess = ShellExecute(0, "Open", "www.google.com")
    
    End Sub
    

    As given in comment, to make it work in 64-bit, you need add PtrSafe in the Private Declare Line as shown below:

    Private Declare PtrSafe Function ShellExecute _
    

    Just a short remark concerning security: If the URL comes from user input make sure to strictly validate that input as ShellExecute would execute any command with the user’s permissions, also a format c: would be executed if the user is an administrator.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I open a html page with a myApp.js included like this: <html> <body> ......
//Html - page containing link to open dialog <input type=text value=something id=inputbox_id /> <a
I want to open html files from a shell script. I know that Ubuntu
I am trying to open html file http://www.geocodezip.com/v3_MW_example_map3.html from my computer. I can open
I have an html page that open a popup window when the page loads.
I have an html page which has a link called open. Once the link
I'm trying to load a local web page executing: var html = document.open('google.html'); document.documentElement.innerHTML
This is my Html.I need to open (same page)Page1.html in a new window, when
The HTML below will show a page with 2 buttons. One will open a
I'm loading a webpage inside a HTML component in AIR. By default, when something

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.