How to Fix Excel Macro Not Found When Clicking a Shape Button
Question details
The user is encountering a 'macro not found' error when attempting to run an Excel macro by clicking an assigned shape or button, even though the macro executes perfectly from the Tools menu.

- Product
- Microsoft Excel
- Device & OS
- Mac
- Scenario
- Assigning and triggering a VBA macro via a shape or print button within a workbook.
- Observed behavior
- Clicking the assigned shape button produces a 'macro not found' error dialog, while manually running the macro from the standard menu works without issue.
Ensure that your workbook is saved as an Excel Macro-Enabled Workbook (.xlsm) and verify that the macro name contains no spaces or unsupported special characters.
Save the Workbook Under a New Name
Bypass file-level corruption by saving the spreadsheet with a completely new file name and reassigning the macro to the shape.
Often, the connection between a shape object and the VBA module becomes corrupted internally within the file structure. Saving the file as a new document forces Excel to rebuild these internal links.
Open the problematic workbook, click on 'File' in the top menu, and select 'Save As'. Enter a completely new name for the file and ensure the format is set to Excel Macro-Enabled Workbook (.xlsm).
Delete the original shape or print button. Go to 'Insert' > 'Shapes' and draw a new shape on your worksheet.
Right-click the newly created shape, select 'Assign Macro' from the context menu, choose your macro from the list, and click 'OK'.
Deselect the shape and click it again to verify that the macro now runs successfully without triggering the error.

Update Excel for Mac to the Final Supported Build
Resolve underlying software bugs by updating Excel for Mac 2011 from its original build to the final supported version.
Experience Stable Macro Execution with WPS Office
Struggling with legacy Excel versions and corrupted files? WPS Office is a modern, lightweight, and free alternative that offers comprehensive support for VBA macros and seamless compatibility with Microsoft Excel formats.
- 1. Download and Install: Download WPS Office for free from the official website and install it on your device.
- 2. Open Your Workbook: Launch WPS Spreadsheet, go to 'Menu' > 'Open', and select your macro-enabled workbook (.xlsm).
- 3. Enable Macros and Run: Click 'Enable Macros' in the security warning prompt, then click your shape button to run the macro smoothly.

Frequently Asked Questions
Why does my macro work from the menu but not from a shape button?
This discrepancy often occurs due to minor workbook corruption or broken internal XML links between the visual shape object and the VBA module. Renaming the file and reassigning the macro forces the application to rebuild these links.
How do I correctly assign a macro to a shape in Excel?
Right-click the target shape or button, select 'Assign Macro' from the context menu, choose the desired macro from the dialog box list, and click OK. Ensure your workbook is subsequently saved as a Macro-Enabled Workbook (.xlsm).
Can a space in the macro name cause the 'macro not found' error?
Yes. Invalid macro names, especially those containing spaces or special characters, can break the assignment link. Ensure your VBA subroutine names only use letters, numbers, and underscores (e.g., 'Run_Report' instead of 'Run Report').




