How to Open a Website URL from Microsoft Access VBA
Question details
The user needs to know how to launch a web browser link directly using VBA in Microsoft Access without assigning the URL to a form control's HyperlinkPart property.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Executing a VBA script within a Microsoft Access application to open a specific website in the user's default external web browser.
- Observed behavior
- The user wants to programmatically trigger the default web browser to open a URL using a VBA macro or script.
Ensure you have a complete, valid URL (including the http:// or https:// prefix) ready to test in your VBA script and verify that macros are enabled in your Access database.
Use the Application.FollowHyperlink Method
This is the most reliable and standard approach to open a URL in the system's default web browser directly from Access VBA.
The FollowHyperlink method passes the URL string to the operating system, which then opens it using the default application registered for web links.
Open your Microsoft Access database and press ALT + F11 to launch the Visual Basic for Applications (VBA) Editor.
Insert a new code module from the 'Insert' menu, or open the existing code-behind file for your specific Access form.
Type the following command into your subroutine: Application.FollowHyperlink "https://example.com" (replace the example URL with your actual web address).
Execute your macro or trigger the form event to launch the default browser and automatically navigate to the specified webpage.

Implement a Web Browser Control (For In-Form Display)
Use this method if the webpage must be displayed or interacted with directly inside the Microsoft Access form rather than in an external browser window.
Looking for a Lightweight Office Suite?
While Microsoft Access is a specialized database management tool, for your everyday document, spreadsheet, and presentation needs, WPS Office offers a powerful, free, and lightweight alternative to Microsoft Office. It provides excellent compatibility with Word, Excel, and PowerPoint formats in an intuitive, tabbed interface.
- 1. Download the installer: Visit the official WPS Office website and download the free installation package for your operating system.
- 2. Install WPS Office: Run the downloaded installer and follow the on-screen prompts to set up the software.
- 3. Open existing files: Launch WPS Office and directly open your existing Word, Excel, or PowerPoint documents without losing any formatting.

Frequently Asked Questions
Can I open a specific browser like Google Chrome using Access VBA?
Yes, instead of using FollowHyperlink (which uses the default browser), you can use the VBA Shell function to call a specific browser's executable file followed by the URL. For example: Shell("chrome.exe https://example.com", vbNormalFocus).
Why do I get a runtime error when using FollowHyperlink in VBA?
Errors typically occur if the URL string is missing the protocol prefix (like http:// or https://), if the string contains invalid characters, or if the system cannot locate a default application to handle web links. Ensure your URL is fully qualified.
Is the SendKeys method a reliable way to open a website in VBA?
No, using SendKeys to simulate typing a URL into a browser is generally not recommended. It is unreliable because it relies on the correct application window having active focus at the exact moment the keys are sent. Application.FollowHyperlink is a much safer and cleaner method.




