VBA & Macro Problems

How to Fix VBA Hyperlinks to Hidden Sheets Not Working in Excel for the Web

Muhammad TalhaMuhammad Talha Oct 26, 2026 868 views

Question details

The user needs to use a VBA macro triggered by a hyperlink to unhide and navigate to a hidden worksheet within Excel for the web.

How to Fix VBA Hyperlinks to Hidden Sheets Not Working in Excel for the Web
Product
Excel for the Web
Device & OS
not provided
Scenario
Clicking a hyperlink in a workbook to run a VBA macro that unhides a specific worksheet and selects a target cell while working in a web browser environment.
Observed behavior
The VBA macro fails to execute because Excel for the web does not support running or editing VBA code.
Before you start

Verify that your workbook is saved in a macro-enabled format (.xlsm) and ensure you have the desktop version of Microsoft Excel installed on your computer.

Solution 1Recommended

Open the Workbook in the Excel Desktop Application

Since Excel for the web cannot run VBA macros, the most direct solution is to open the file in the desktop application where VBA is fully supported.

Excel for the web restricts the execution of VBA macros for security and compatibility reasons. To utilize your existing VBA code that unhides sheets upon a hyperlink click, you must transition to the desktop version of Excel.

1
Locate the Ribbon menu

While viewing your workbook in Excel for the web, look at the top ribbon menu.

2
Switch to Desktop App

Click the 'Viewing' or 'Editing' button at the top of the window, then select 'Open in Desktop App' from the dropdown menu.

3
Enable macros

Once the file opens in your desktop Excel application, look for a yellow security warning bar beneath the ribbon and click 'Enable Content' to activate macros.

4
Click the hyperlink

Click the hyperlink in your workbook. The VBA macro will now successfully execute, unhide the target sheet, and jump to the specified cell.

Open the Workbook in the Excel Desktop Application
Full Compatibility: Any subsequent edits made in the desktop app will automatically sync back to Excel for the web if the file is stored in OneDrive or SharePoint.
Free Microsoft Office alternative

Use WPS Office to Run Your VBA Macros Seamlessly

Since Excel for the web restricts VBA macros, switching to a powerful desktop alternative like WPS Office allows you to retain full macro functionality without the subscription cost. WPS Office offers a free, lightweight suite with high format compatibility, an intuitive familiar UI, and seamless migration for your existing workbooks.

  1. 1. Download WPS Office: Install the free WPS Office suite on your desktop computer.
  2. 2. Open your workbook: Launch WPS Spreadsheet and open your existing .xlsm macro-enabled file.
  3. 3. Use your macros: Click your hyperlinks to trigger the VBA macros and unhide sheets perfectly.
Fully compatible with Microsoft Excel formats (.xlsx, .xlsm)Supports advanced VBA and macros natively in the desktop environmentLightweight application that runs smoothly on most operating systemsFree to use with a familiar tabbed interface requiring zero learning curve
microsoft office alternative - wps office

Frequently Asked Questions

Why do my hyperlinks to hidden sheets work on desktop but not online?

Excel for the web does not support running VBA macros. Since unhiding a sheet via a hyperlink requires a VBA worksheet event (like Worksheet_FollowHyperlink), the action will only execute successfully in the desktop application where VBA engines are fully functional.

Can I edit my existing VBA macros directly in Excel for the web?

No, you cannot create, run, or edit VBA macros in Excel for the web. While you can open and edit the non-macro data within a macro-enabled workbook online, modifying the underlying VBA code requires switching to the desktop application.

Is there a way to trigger an Office Script automatically by clicking a hyperlink?

Currently, Office Scripts do not support event-based triggers such as clicking a hyperlink. To execute an Office Script, you must assign the script to a clickable form button on the sheet or run it manually from the Automate tab.