logo
search
VBA & Macro Problems

Fix Excel VBA Errors When Code Suddenly Stops Working

Maira MehtabMaira Mehtab Sep 21, 2026 869 views

Question details

The user is experiencing abrupt failures in Excel VBA code handling drop-down interactions, resulting in Run-time error 1004 and Run-time error 424.

Product
Excel
Device & OS
not provided
Scenario
Executing worksheet event procedures that move rows based on drop-down changes and handle multiple selections.
Observed behavior
The VBA code unexpectedly stops functioning. The multiple-selection procedure throws Run-time error 1004 at Application.Undo, while the row-movement procedure throws Run-time error 424 (Object required) near a column check.
Before you start

Ensure that macros are enabled in your spreadsheet software settings and verify that your Visual Basic Editor has access to the affected worksheet code modules.

Solution 1Recommended

Re-enable Application Events via the Immediate Window

If your worksheet event macros suddenly stop triggering without any code changes, the Application.EnableEvents property may have been disabled during a previous error and needs to be manually restored.

1
Open the Visual Basic Editor

In your spreadsheet application, press Alt + F11 to open the Visual Basic Editor (VBE).

2
Access the Immediate Window

Press Ctrl + G to display the Immediate Window, usually located at the bottom of the editor interface.

3
Run EnableEvents Command

Type 'Application.EnableEvents = True' into the Immediate Window and press Enter to execute the command.

4
Test the Macros

Return to your worksheet and interact with the drop-down menus again to verify if the event code triggers successfully.

Troubleshoot and Run VBA Macros in WPS Spreadsheet

WPS Spreadsheet features a powerful, built-in Visual Basic Editor that allows you to write, edit, and debug macros efficiently, providing a reliable environment for advanced automated workflows.

  1. 1. Open Macro Workbook: Launch WPS Spreadsheet and open your macro-enabled (.xlsm) file.
  2. 2. Access Developer Tools: Navigate to the 'Tools' tab on the top ribbon and click on 'Developer'.
  3. 3. Open Visual Basic Editor: Click on 'Visual Basic Editor' or press Alt + F11 to access your macro code modules.
  4. 4. Execute Immediate Commands: Press Ctrl + G to open the Immediate Window, type your debugging commands, and press Enter to execute them instantly.
Highly compatible with Microsoft Excel VBA macros and .xlsm formatsBuilt-in Visual Basic Editor for seamless code debuggingRobust execution of complex event procedures and scripts
microsoft office alternative - wps office

Frequently Asked Questions

Why did my Worksheet_Change event macro suddenly stop working?

Event macros typically stop working if 'Application.EnableEvents' is set to False in your VBA code to prevent recursive loops, and the code subsequently crashes before it can set the property back to True. Re-enabling it via the Immediate Window resolves this.

What causes Run-time error 1004 in Excel VBA?

Run-time error 1004 is a generic error that often occurs when a requested object is missing, a worksheet is protected, or a specific method is called inappropriately, such as calling 'Application.Undo' when there are no recent actions recorded in the undo stack.

How do I fix Run-time error 424 Object Required?

This error means VBA expects a defined object but encountered something else. To fix it, ensure you use the 'Set' keyword when assigning variables to objects (e.g., Set myRange = Range("A1")) and verify that your object references contain no spelling mistakes.