Microsoft KB Archive/68254

Text Box Does Not Size Properly in Dialog Editor PSS ID Number: Q68254 Article last modified on 02-26-1993 PSS database name: W_eXceL

2.x 3.00

WINDOWS

Summary:

The gray box displayed around text in a dialog box created in Excel’s Dialog Editor may not size properly when text is entered. The box may extend too far to the right, or it may not move far enough to the right.

Microsoft has confirmed this to be a problem in Excel for Windows versions 2.x and 3.0. This problem was corrected in Microsoft Excel for Windows version 4.0.

More Information:

To duplicate the problem, do the following:

  Start the Dialog Editor in Excel by doing the following:  Press ALT+SPACEBAR+U. Select the Dialog Editor option. Choose OK.   Choose Text from Item menu.   Type a text string. 

If you use letters with average size, such as “a, s, d,” the gray box will expand properly.

If you type small letters, such as “i, j, l,” the gray box may extend too far to the right. This will cause a problem if any other object has been placed in the area that the box overrides. When the dialog box is later displayed by the macro, the second object may not completely display. This problem must be corrected by editing the width field in the dialog box area of the macro sheet.

If you type large letters, such as “D, A, X,” all the text will not display because the gray box will not extend far enough to the right. As a result, the right-hand side of the text will be covered.

Solution
Typing extra spaces at the end of your text will extend the box and correct a situation where the box isn’t wide enough.

If the box is too wide, it will be necessary to choose Info from the Edit menu. This informational dialog allows us to view and edit current settings for the dialog or dialog item. The Width edit box will allow us to change the dimensions of this box. If you uncheck the Auto box next to Width, the default setting will be displayed. Increase this number by approximately 5 until all of the characters display.

Reason for Problem
This problem occurs because Excel is treating the text as if the font was fix-spaced. The box extends the same distance to the right for each character that is typed, regardless of the character’s actual width.

This behavior is less evident in Excel version 3.00.

References:

Appendix A, “Microsoft Excel Dialog Editor”, in Microsoft Excel Reference version 2.1.

“Microsoft Excel User’s Guide”, version 3.00, page 624.

Copyright Microsoft Corporation 1993.