This Site generates Code for the
MsgBox function used in VBScript and VBA,
or for the
MessageBox(A/W) API functions.
You can hover over most titles to get some help.
Note that this application will not stop you from making invalid choices, for example selecting default button 3 when only one button is present. This Windows API call is fairly tolerant towards invalid combinations.
To decode a message box option number, click here
Options marked with an Asterisk are not mentioned in the
They are listed because the underlying API call to
MessageBox(A/W) documents them,
which makes them valid choices.
Save this to a file with extension
or paste it into a VBA macro.
hWnd with your current window handle,
NULL if no window is present.
Users can close the dialog using the ESC key if either a "Cancel" button is present, or the dialog contains only an "OK" button. The returned value from the dialog function is the respective button code.