XL5: MsgBox Function Doesn't Display System Modal Dialog Box

Last reviewed: November 8, 1996
Article ID: Q120407
The information in this article applies to:
  • Microsoft Excel for Windows, version 5.0

SYMPTOMS

In 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.

CAUSE

When 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.

STATUS

Microsoft 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.

REFERENCES

For more information about the MsgBox Function, choose the Search button in the Visual Basic Reference and type:

    MsgBox


KBCategory: kbprg
KBSubcategory:

Additional reference words: 5.00



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 8, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.