Modal

The most common type of dialog box is a modal dialog box.
By default all userforms are displayed as modal which means that the user must close the userform before they can continue to use the application.
When a UserForm is modal, the user must supply information or close the userform before using any other part of the application. No subsequent code is executed until the userform is hidden or unloaded.
Although other forms in the application are disabled when a userform is displayed, other applications are not.

Userform1.Show ([modal]) 

modal - A boolean value that determines if the userform is displayed as a modal userform or a modeless userform.

Userform1.Show() 
Userform1.Show (VBA.FormShowConstants.vbModal) 'this is the default
Userform1.Show (1)

Sub Macro1() 
   Load UserForm1
   UserForm1.Show (VBA.FormShowConstants.vbModal)
End Sub

VBA.FormShowConstants.vbModal = 1
VBA.FormShowConstants.vbModeless = 0


ShowModal property

The default value for this property is True which will display the userform in a modal mode.
You can change this to False if you would rather display the userform in a modeless mode.

alt text




© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext