Fix Excel VBA UserForm Freezing with ShowModal False
Question details
The user's Excel VBA UserForm freezes or becomes unresponsive when the ShowModal property is set to False.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Running a modeless UserForm containing RefEdit controls or complex event routines in Excel VBA.
- Observed behavior
- The UserForm freezes, crashes, or exhibits unreliable behavior when interacting with the controls or triggering command button events.
Open the VBA Editor (Alt + F11) and ensure the affected UserForm is completely closed and not currently executing in the background before attempting to modify its properties or control code.
Change the UserForm to Modal or Replace RefEdit Controls
RefEdit controls are known to be unreliable on modeless forms. The best approach is to either make the form modal or replace the RefEdit controls with standard TextBoxes.
RefEdit controls are specifically designed to be used on modal dialog boxes. When placed on a modeless form (where the ShowModal property is False), they often cause the UserForm or the entire Excel application to freeze or crash due to focus conflicts.
Press Alt + F11 in Excel to open the Visual Basic for Applications Editor.
In the Project Explorer pane on the left, find and select the UserForm that is causing the freezing issue.
In the Properties window (press F4 if it is not visible), locate the 'ShowModal' property and change its value from False to True.
If you absolutely must use a modeless form, delete the RefEdit control from the UserForm and replace it with a standard TextBox control.

Remove Unnecessary Code from the Enter Event
Prevent recursive loops and crashes by removing execution code from the command button's Enter event and placing it strictly in the Click event.
Try WPS Office for Seamless Excel Compatibility
If you frequently encounter limitations or bugs with native Microsoft Office controls like RefEdit, consider trying WPS Office. It is a free, lightweight, and highly compatible alternative that smoothly handles complex spreadsheets and macros.

Frequently Asked Questions
What is a modeless UserForm in Excel VBA?
Setting a UserForm's ShowModal property to False creates a modeless form. This allows the user to click away from the UserForm to interact with the Excel worksheet and other windows while the form remains open and visible on the screen.
Why does the RefEdit control cause Excel to freeze?
RefEdit controls are highly unstable when used outside of modal UserForms. Because a modeless form shares focus with the underlying worksheet, interacting with a RefEdit control can create an infinite loop of focus events, leading to a freeze or crash.
How can I select a cell range without using a RefEdit control?
You can use the Application.InputBox function with the Type parameter set to 8. This triggers a native Excel prompt that allows users to securely select a range with their mouse, and you can output the selected address to a standard TextBox on your UserForm.




