Fix Excel VBA Errors When Code Suddenly Stops Working
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.
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.
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.
In your spreadsheet application, press Alt + F11 to open the Visual Basic Editor (VBE).
Press Ctrl + G to display the Immediate Window, usually located at the bottom of the editor interface.
Type 'Application.EnableEvents = True' into the Immediate Window and press Enter to execute the command.
Return to your worksheet and interact with the drop-down menus again to verify if the event code triggers successfully.
Debug Run-time Errors 1004 and 424
If re-enabling application events does not resolve the issue and error prompts still appear, manually inspect the specific code statements causing the failure.
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. Open Macro Workbook: Launch WPS Spreadsheet and open your macro-enabled (.xlsm) file.
- 2. Access Developer Tools: Navigate to the 'Tools' tab on the top ribbon and click on 'Developer'.
- 3. Open Visual Basic Editor: Click on 'Visual Basic Editor' or press Alt + F11 to access your macro code modules.
- 4. Execute Immediate Commands: Press Ctrl + G to open the Immediate Window, type your debugging commands, and press Enter to execute them instantly.

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.




