XL5: MsgBox Function Doesn't Display System Modal Dialog BoxLast reviewed: November 8, 1996Article ID: Q120407 |
The information in this article applies to:
SYMPTOMSIn Microsoft Excel, when you use the MsgBox function in a Visual Basic procedure with the VBSystemModal constant in the Buttons argument, an application modal dialog box displays instead of a system modal dialog box.
CAUSEWhen you use the MsgBox function to display a message in a dialog box, you can choose the modality of the dialog box with the value you use for the Buttons argument. A modal dialog box is one that you must respond to before you can continue working. A modeless dialog box, on the other hand, is one that allows you to perform some action even while the dialog box is displayed. If you use the Microsoft Excel constant vbApplicationModal, or the value 0, in the buttons argument, an application modal dialog box is displayed; that is you must respond to the message box before you can continue working in Microsoft Excel. The Visual Basic Reference indicates that you can use the Microsoft Excel constant vbSystemModal, or the value 4096, in the buttons argument to display a system modal dialog box; that is all applications are suspended until the you respond to the message box. However, when you use the vbSystemModal constant, or the value 4096, in the MsgBox function, the message appears in an application modal dialog box, not a system modal dialog box.
STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in a later version of Microsoft Excel. Note that on the Macintosh, application modal dialog boxes are not supported. Therefore, whether you use the vbApplicationModal or vbSystemModal constant in the MsgBox function, in Microsoft Excel 5.0 for the Macintosh, a system modal message box is displayed.
REFERENCESFor more information about the MsgBox Function, choose the Search button in the Visual Basic Reference and type:
MsgBox |
KBCategory: kbprg
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |