How to Fix VBA Hyperlinks to Hidden Sheets Not Working in Excel for the Web
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.

- 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.
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.
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.
While viewing your workbook in Excel for the web, look at the top ribbon menu.
Click the 'Viewing' or 'Editing' button at the top of the window, then select 'Open in Desktop App' from the dropdown menu.
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.
Click the hyperlink in your workbook. The VBA macro will now successfully execute, unhide the target sheet, and jump to the specified cell.

Redesign the Workbook with Visible Sheets
If users must interact with the file exclusively in the web browser, remove the VBA dependency by keeping target sheets visible.
Use Office Scripts as a Web Alternative
Recreate the unhide functionality using Office Scripts, which are supported in Excel for the web, though they require manual execution via a button instead of a hyperlink.
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. Download WPS Office: Install the free WPS Office suite on your desktop computer.
- 2. Open your workbook: Launch WPS Spreadsheet and open your existing .xlsm macro-enabled file.
- 3. Use your macros: Click your hyperlinks to trigger the VBA macros and unhide sheets perfectly.

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.




