Fix Excel Macro Buttons That Stop Working After Editing
Question details
Find out why assigned Excel macro buttons stop responding after a macro is edited and work again only after the workbook is reopened.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A user edits a VBA macro and then tries to run it using a button assigned in the workbook.
- Observed behavior
- The buttons do not respond until the workbook is saved, closed, and reopened.
Save a copy of the macro-enabled workbook for testing, and note which buttons and macros are affected. Confirm that the file comes from a trusted source before enabling macros.
Check the VBA project and button assignment
Use these checks to rule out an interrupted macro, a compilation error, or a broken button assignment.
Open Developer > Visual Basic. If the editor is in break mode, choose Run > Reset, then select Debug > Compile VBAProject and correct any reported errors.
For a Form Control button, right-click the button and select Assign Macro. Confirm that the intended macro is selected and click OK.
For an ActiveX button, open the Developer tab and turn off Design Mode before clicking the button. In Visual Basic, check that its Click event still calls the intended code.
Save the workbook as a macro-enabled file, edit the macro again, and click the button. If it still does not respond, test Excel without add-ins.

Test Excel without add-ins or startup workbooks
Use this test to see whether an add-in or startup file is interfering with the buttons.
Inspect Excel startup files and Personal.xlsb
Use this Windows-focused approach if the problem persists or appears related to the personal macro workbook.
Work with Excel Spreadsheets in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface and Microsoft Office format compatibility for a smoother move between office suites. It does not repair Excel's macro-button behavior; check VBA and ActiveX compatibility before relying on automated workbooks.

Frequently Asked Questions
Why do my macro buttons work again after I reopen the workbook?
Reopening resets the workbook and Excel session, but it does not identify the cause. Check for VBA errors with Developer > Visual Basic > Debug > Compile VBAProject, then test add-ins and startup files.
How do I check which macro a button runs?
For a Form Control button, right-click it and select Assign Macro. For an ActiveX button, inspect its Click event in Developer > Visual Basic and make sure Developer > Design Mode is off.
Where can I find Excel's XLSTART folder?
Open Developer > Visual Basic, press Ctrl+G, enter ?Application.StartupPath in the Immediate Window, and press Enter. Excel displays its startup folder path.
What should I do if the issue cannot be reproduced without seeing the workbook?
Create a test copy, remove confidential information, and share it through an approved file-sharing service with someone who can inspect the VBA project and button controls.




