Microsoft KB Archive/50508

{| = Excel: Illegal Dialog Error, Values Rounded in Custom Dialog =
 * width="100%"|

Last reviewed: November 2, 1994

Article ID: Q50508

SUMMARY
Note: This behavior only occurs in versions of Microsoft Excel prior to version 3.00. Excel 3.00 does not depend on the width of the column for displaying values in a user defined dialog box.

After entering a number into a custom dialog box in Excel, when the dialog box is called up a second time, you may get a dialog box error, or the number may be rounded, if the Initial/Result column of the dialog box table is not sufficiently wide.

If you are working with an integer edit field or a number edit field in a user-defined dialog, the initial/result column (column 7) must be wide enough to display the value of the cell with display set to Show Values (that is, Show Formulas turned off). Macro sheets default to displaying formulas, which display columns twice as wide as when displaying values. If the width of the initial/result column in your user-defined dialog descriptor is too narrow, one of the following problems can occur:


 * 1) An initial value you set for an edit integer or edit number field may not display.
 * 2) You may receive an &quot;Illegal dialog value at [ref]&quot; alert when the =DIALOG.BOX statement is executed.
 * 3) The value may be rounded to the number of digits that display on the macro when Formula Display is turned off.

To ensure the correct value is displayed in the dialog, make sure the column is wide enough to display the formatted value when the macro sheet is displaying values rather than formulas.
 * }