XL98: OK Button in Message Box Is Right-Aligned or Centered

Last reviewed: February 6, 1998
Article ID: Q180448
The information in this article applies to:
  • Microsoft Excel 98 Macintosh Edition

SYMPTOMS

In Microsoft Excel 98 Macintosh Edition, if you run a Microsoft Visual Basic for Applications macro (Sub procedure) that displays a message box, the OK button in the message box may appear either right-aligned or center- aligned.

For example, the message box may appear like this

   This is a somewhat long text string to show in a message
   box.

                                             [     OK     ]

or like this:

   Short message.

   [     OK     ]

STATUS

This behavior is by design of Microsoft Excel 98 Macintosh Edition.

MORE INFORMATION

Different versions of Microsoft Excel use different methods to determine the size of message boxes and the location of the OK button in a message box:

   Version of            Size of                  Location
   Microsoft Excel       Message Box              of OK Button
   --------------------------------------------------------------------

   Microsoft Excel 98    Changes to accommodate   Fixed distance from
   Macintosh Edition     text                     right side of message
                                                  box

   Microsoft Excel 5.0   Fixed width; message     Fixed distance from
   for the Macintosh     box is always the same   right side of message
                         size                     box

   Microsoft Excel for   Changes to accommodate   Centered
   Windows               text

Because of the behavior of message boxes in Microsoft Excel 98 Macintosh Edition, the OK button may appear to be either right-aligned or centered within the message box, depending on the length of the message. In both cases, however, the button is actually right-aligned.

Note that this behavior does not apply to UserForms; if you create a UserForm that contains a label and a command button, the UserForm will appear correctly when you display it.


Additional query words: XL98 right flush
Keywords : kbprg xlvbainfo xlui
Version : MACINTOSH:98
Platform : MACINTOSH
Issue type : kbprb


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: February 6, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.