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

ID: Q120407

5.00 WINDOWS kbprg

The information in this article applies to:

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

Version           : 5.00
Platform          : WINDOWS

Last Reviewed: November 10, 1996