Excel VBA MsgBox Without Buttons: Workarounds & Alternatives
Question details
The user needs a way to display an Excel VBA MsgBox without requiring the user to click OK, Cancel, Yes, or No buttons.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Displaying non-interactive notifications, warnings, or status messages while a macro continues to run.
- Observed behavior
- A standard VBA MsgBox always includes at least one button and halts script execution until the user manually interacts with it.
Ensure the Developer tab is enabled in your Excel ribbon and that macros are allowed in your Trust Center settings before writing and executing VBA code.
Use a Modeless UserForm for Non-Interactive Messages
Because a standard VBA MsgBox always requires user interaction, creating a modeless UserForm is the standard alternative to display messages without buttons.
A standard VBA message box is 'modal', meaning it pauses code execution and requires a button click to proceed. There is no built-in way to disable or remove all buttons from a default MsgBox.
By using a 'modeless' UserForm, you can display a notification on the screen while allowing the underlying macro to continue running or letting the user interact with the spreadsheet.
Press Alt + F11 on your keyboard to open the Visual Basic for Applications (VBA) editor in Excel.
Click on 'Insert' in the top menu and select 'UserForm'. A blank form will appear on your screen.
Using the Toolbox, drag a 'Label' control onto the UserForm. Type your desired notification text into the label's Caption property in the Properties window.
In your macro code, display the form using the vbModeless parameter by typing: `UserForm1.Show vbModeless`. This allows the message to stay on screen without requiring a button click.

Create Custom UserForms and Macros with WPS Spreadsheet
WPS Office provides robust VBA and macro support, allowing you to easily build complex automated workflows, custom dialog boxes, and modeless UserForms without switching software.
- 1. Enable the Developer Tab: Open WPS Spreadsheet, go to the top ribbon, click 'Options', and enable the 'Developer' tab to access macro tools.
- 2. Open the VBA Editor: Click the 'Developer' tab and select 'Visual Basic' or simply press Alt + F11 to launch the integrated VBA editor.
- 3. Design Your UserForm: Right-click the project pane, choose 'Insert' > 'UserForm', and use the toolbox to add custom labels and designs without buttons.
- 4. Run Your Code: Write your macro using the `vbModeless` parameter and run it to display your non-interactive message box seamlessly in WPS Office.

Frequently Asked Questions
Is it possible to make an auto-closing MsgBox in VBA?
Yes, although the standard MsgBox cannot close itself, you can use the `CreateObject("WScript.Shell").Popup` method. This allows you to set a timer in seconds, after which the message box automatically dismisses.
Why does the standard MsgBox halt my macro execution?
The standard VBA MsgBox is a modal dialog. Modal dialogs suspend all background code execution and block user interaction with the application until a valid response (like clicking OK or Cancel) is provided.
Can I remove the close (X) button from a VBA UserForm?
Removing the close button entirely requires complex Windows API calls. A simpler alternative is to disable it by intercepting the `QueryClose` event in the UserForm's code module and cancelling the close action if triggered by the user.




