How to Open a Hidden Excel Worksheet from a Graphic Using VBA
Question details
The user needs to use VBA to reveal and navigate to a hidden Excel worksheet by clicking on a graphic or SmartArt object.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Creating an interactive spreadsheet where clicking a graphical object triggers a VBA script or hyperlink to open a hidden sheet.
- Observed behavior
- A standard VBA hyperlink works for regular cells but fails when assigned to a graphic or SmartArt object if the target worksheet is hidden.
Ensure that the Developer tab is enabled in your ribbon and that your workbook is saved in a macro-enabled format (.xlsm) to allow VBA scripts to execute properly.
Use VBA to Assign a Hyperlink and Unhide the Target Sheet
Configure a hyperlink directly to the graphic using VBA by targeting the SubAddress, and ensure the target worksheet is unhidden before the link is executed.
Spreadsheet applications cannot natively navigate to a hidden worksheet using standard hyperlinks. When working with graphics or SmartArt, you must use VBA to correctly assign the hyperlink's SubAddress and ensure the target sheet becomes visible right before the navigation occurs.
In your VBA Editor, select the graphic by its name and use the Delete method on its hyperlink properties to remove any existing, conflicting links.
Use the Hyperlinks.Add method applied to the graphic's shape object. Leave the Address parameter empty and set the SubAddress to your target worksheet and cell (for example, 'TargetSheet!A1').
Since Excel cannot jump to a hidden sheet, write an event macro (such as a Worksheet selection change) or a shape-assigned macro that changes the target sheet's Visible property to True right before following the hyperlink.
Easily Manage VBA and Macros with WPS Spreadsheet
WPS Office provides robust support for VBA and macros, allowing you to easily assign custom scripts to graphics and navigate through hidden worksheets seamlessly.
- 1. Enable the Developer Tab: Open WPS Spreadsheet, navigate to the settings menu, and enable the Developer tools to access the Visual Basic Editor.
- 2. Write the Navigation Script: Click 'Visual Basic' in the Developer tab, insert a new module, and write a simple script to unhide your target worksheet and select it.
- 3. Assign the Macro to Your Graphic: Right-click the graphic, shape, or SmartArt in your worksheet, select 'Assign Macro' from the context menu, and choose your newly created navigation script.

Frequently Asked Questions
Why does clicking a hyperlink to a hidden worksheet result in an error?
Spreadsheet applications cannot navigate to a sheet that is not visible. The target worksheet must be unhidden (its Visible property set to True) before the hyperlink can successfully execute.
How can I assign a VBA macro directly to a graphic?
Right-click the graphic or SmartArt object in your spreadsheet, select 'Assign Macro' from the context menu, and choose the specific VBA script you want to run when the object is clicked.
Can I automatically hide the worksheet again after I leave it?
Yes. You can open the VBA Editor, access the code module for the specific target worksheet, and use the Worksheet_Deactivate event to automatically change its visibility back to hidden (xlSheetHidden) whenever you switch to another tab.
How do I remove an old hyperlink from a graphic using VBA?
You can use the Shape.Hyperlink.Delete method in your VBA script to clear any existing hyperlinks on a selected graphic before assigning a new macro or link.




