VBA & Macro Problems

Fix Excel VBA Button Not Working and VBA Code Won't Open

Khadija KhanKhadija Khan Oct 23, 2026 868 views

Question details

The user needs to troubleshoot an Excel workbook where VBA buttons are unresponsive, Design Mode is unavailable, and the VBA editor fails to open worksheet code.

How to Fix Excel VBA Button Not Working and Code Not Opening
Product
Microsoft Excel
Device & OS
Windows
Scenario
Attempting to run a VBA macro via a button or edit VBA code in an existing Excel workbook.
Observed behavior
The VBA button does nothing when clicked, Design Mode is unavailable or grayed out, and the worksheet code will not open in the Visual Basic Editor.
Before you start

Ensure your workbook is not opened in Protected View, and verify that macros are enabled in your Excel Trust Center settings before proceeding.

Solution 1Recommended

Verify ActiveX Controls and Enable Macros

Ensure the workbook contains valid ActiveX controls and that your macro security settings allow them to run.

Design Mode in Excel is only available when the workbook contains an object that it can manage, such as an ActiveX control. If your buttons are Form Controls instead of ActiveX, Design Mode will intentionally remain disabled.

1
Open the Developer Tab

Launch Excel, open your workbook, and navigate to the 'Developer' tab on the ribbon.

2
Inspect ActiveX Controls

Click 'Visual Basic' or 'View Code' to inspect the workbook's modules. Check if the expected ActiveX controls actually exist in the project.

3
Enable Macros in Trust Center

Go to 'File' > 'Options' > 'Trust Center' > 'Trust Center Settings' > 'Macro Settings'. Select 'Enable VBA macros' and check 'Trust access to the VBA project object model', then click 'OK'.

Verify ActiveX Controls and Enable Macros
Unprotect Workbook: If the 'View Code' option is grayed out, the workbook or worksheet might be protected. Go to the 'Review' tab and click 'Unprotect Sheet' or 'Unprotect Workbook' first.
Free Microsoft Office alternative

Try WPS Office for a Stable and Free VBA Experience

If Microsoft Excel continues to experience VBA crashes, broken buttons, or ActiveX control issues, consider switching to WPS Office. It offers a highly compatible spreadsheet application with robust macro support, allowing you to run your VBA scripts smoothly in a lightweight, stable environment.

  1. 1. Download WPS Office: Download and install WPS Office for free from the official website.
  2. 2. Open Your Macro Workbook: Launch WPS Spreadsheet, go to 'Menu' > 'Open', and select your existing Excel macro-enabled workbook (.xlsm).
  3. 3. Run Your Macros: Click 'Enable Macros' if prompted by the security warning. Navigate to the 'Developer' tab to access the VBA Editor and test your buttons.
Fully compatible with Microsoft Excel macro-enabled formats (.xlsm, .xlsb, .xls).Built-in VBA editor to seamlessly create, edit, and troubleshoot macros.Lightweight installation with faster load times and fewer application crashes.Free to use with a familiar, easy-to-navigate tabbed user interface.
microsoft office alternative - wps office

Frequently Asked Questions

Why is the Design Mode button grayed out in Excel?

Design Mode is only clickable when the active worksheet contains a manageable object, such as an ActiveX control. If your sheet relies entirely on Form Controls or has no objects, Design Mode will remain disabled.

How do I unprotect a workbook to edit VBA code?

Go to the 'Review' tab on the Excel ribbon and click 'Unprotect Sheet' or 'Unprotect Workbook'. If the VBA project itself is locked with a password, open the Visual Basic Editor (ALT + F11), right-click the project, select 'VBAProject Properties', and remove the password under the 'Protection' tab.

Can Windows updates break Excel VBA buttons?

Yes, certain Windows or Office security updates can occasionally corrupt ActiveX controls (causing broken .exd files). Applying the latest patch from Microsoft or manually clearing your temporary .exd files usually resolves this issue.

Are VBA macros fully supported in WPS Office?

Yes, WPS Office includes excellent VBA support. You can open, edit, and execute your existing Microsoft Excel macros directly within WPS Spreadsheet, utilizing a very similar Visual Basic Editor.