Microsoft KB Archive/68513

{| = Description of Allowed Custom Dialog Box Items for Excel 3.0 =
 * width="100%"|

Last reviewed: November 2, 1994

Article ID: Q68513 The information in this article applies to:
 * Microsoft Excel for Windows, version 3.0, 4.0

SUMMARY
The following is a list of item numbers that are allowed in a Microsoft Excel custom dialog box; included is a description of what they are, what they do, and if they can be used as triggers.

OK Button, Default -- Item 1

OK can be a trigger when 101 is used as an item number. OK closes the dialog box, enters the data from the dialog box into the initial/result column, and returns control to the macro. The name of the button appears in the text column; the button does not have to be called OK. This button is already selected when the dialog box is displayed.

OK Button, Not Default -- Item 3

OK can be a trigger when 103 is used as an item number. OK closes the dialog box, enters the data from the dialog box into the initial/result column, and returns control to the macro. The name of the button appears in the text column; the button does not have to be called OK.

Cancel Button, Not Default -- Item 2

Cancel can be a trigger when 102 is used as an item number. Cancel closes the dialog box and returns control to the macro. The name of the button appears in the text column; the button does not have to be called Cancel.

Cancel Button, Default -- Item 4

Cancel can be a trigger when 104 is used as an item number. Cancel Closes the dialog box and returns control to the macro. The name of the button appears in the text column; the button does not have to be called Cancel. This button is already selected when the dialog box is displayed.

Text -- Item 5

Text cannot be triggered. Text is fixed text that you can use to label items in the dialog box.

Text Edit Box -- Item 6

The text edit box cannot be triggered. It's a box in which you can enter text. The box can be more than one line high. Enter the height of the edit box in the height column. The text edit column for this item is ignored. The initial value is the proposed contents of the edit box.

Integer Edit Box -- Item 7

The integer edit box cannot be triggered. It is like a text edit box, except you can enter only integers from -32765 to 32767. The text column for this item is ignored. The initial value is the proposed contents of the edit box.

Number Edit Box -- Item 8

The number edit box cannot be triggered. It is like a text edit box, except you can enter only numbers. The initial value is the proposed contents of the edit box.

Formula Edit Box -- Item 9

The formula edit box cannot be triggered. It is like a text edit box, except it accepts all formulas. References in the initial/result column are always R1C1-style in the form of text. When these references are displayed in the dialog box, they are converted to the current style of the Microsoft Excel workspace (A1 style is default). If you enter a constant, an equal sign is added before it. If you enter text, it is enclosed in quotation marks.

Reference Edit Box -- Item 10

The reference edit box cannot be triggered. It is like a text edit box, except you can enter only references. References in the initial/result column are always R1C1-style in the form of text. When these references are displayed in the dialog box, they are converted to the current style of the Microsoft Excel workspace (A1 style is default).

Option Button Group -- Item 11

The option button group can be a trigger when 111 is used as an item number. An option button group item must immediately precede each group of option buttons. The text column can contain a label for the group. The initial/result column contains the number of selected option buttons in the following group. The button in the row below the option button group item is button number 1, the next is number 2, etc. If the initial/result column is blank, button 1 is assumed. If the initial/result column contains #N/A, no buttons are selected.

Option Button -- Item 12

Option can be a trigger when 112 is used as an item number. In a group of option buttons, only one button can be selected. The text column contains the name of the button.

Check Box -- Item 13

The check box can be a trigger when 113 is used as an item number. The text column contains the name of the check box. The initial/result column contains TRUE if the check box is turned on, FALSE if it is turned off, or #N/A if the check box is unavailable.

Group Box -- Item 14

The group box cannot be triggered. It is a box used to visually group items within your dialog box. The text column can contain a label for the group.

List Box -- Item 15

The list box can be a trigger when 115 is used as an item number. It's a box containing a list of items. This list is specified in the text column with a name or R1C1-style reference, in the form of text, to a range of cells that contain items for the list box. If the reference is to blank cells or is invalid, no items are displayed in the list box.

The initial/result column contains the number of the selected item in the list box. The first item in the list is number 1, and so on. If the initial/result column is blank, number 1 is assumed. If the initial/result column contains #N/A, no items are selected. If the initial/result column contains a valid name, the list box becomes a multiple selection list box, in which the user can select more than one item from the list. If the name does not exist, Excel will create it. Otherwise, the name can be initialized to refer to a single number or a one-dimensional array (comma separated) of numbers corresponding to the positions in the list of the desired initially selected values. Once you select items from the list and close the dialog box, the numbers in the named array are changed to match the items you have selected. The numbers appear in ascending order in the array.

Linked List Box -- Item 16

Can be a trigger when 116 is used as an item number. It's like a list box, except it must be preceded by a text edit box. When an item is selected in the linked list box, the text of that item is displayed in the edit box. The text column contains a name or an R1C1-style reference, in the form of text, to a range of cells that contains items for the list box. If the reference is to blank cells or is invalid, no items are displayed in the list box. The initial/result column contains the number of the selected item in the list. The first item in the list is number 1, and so on. If the initial/result column contains #N/A, no items are selected.

Icon -- Item 17

The icon cannot be triggered. It displays one of three icons. A 1 in the text column displays a question mark icon, 2 displays the i or information icon, 3 displays the exclamation mark icon.

Linked File List Box -- Item 18

Can be a trigger when 118 is used as an item number. It lists files in a directory. It must precede a linked drive and directory list box and must follow a text edit box. The edit box is used to filter filenames to appear in the linked file list box. The text column is ignored.

Linked Drive and Directory List Box -- Item 19

The linked drive and directory list box can be a trigger when 119 is used as an item number. Lists available drives and directories. Must immediately follow a linked file list box. If a fixed-text item immediately follows a linked-drive-and-directory-list-box item, the fixed-text item displays the name of the current drive and directory, and is updated if the drive or directory changes. The text and initial/result columns are ignored.

Directory Text -- Item 20

Directory text cannot be triggered. It displays the name of the current directory. It does not change after the dialog box is displayed. To display the directory name so it will change as the directory is changed, insert an item 5 after an item 19. The text column and initial/result column are ignored.

Drop-Down List Box -- Item 21

The drop-down list box can be a trigger when 121 is used as an item number. It contains a list of items. The text column contains a reference to the items contained in the list. This can be an R1C1-style reference given as text, a name of a reference, or a name of an array. If the reference is to blank cells or is invalid, no items are displayed in the list. The height column contains the length of the drop-down list when it is displayed. The initial/result column contains the number of the selected list item. The first item in the list is number 1, and so on. If the initial/result column is blank, number 1 is assumed. If the initial/result column contains #N/A, no items are selected.

Drop-Down Combination Edit/List Box -- Item 22

The drop-down combination edit/list box cannot be triggered. It is like a drop-down list box, except it must be preceded by a text edit box. You can edit the item in the edit box before the list is displayed. The height column contains the length of the drop-down list when it is displayed. The text column contains a reference to the items contained in the list. This can be an R1C1-style reference given as text, a name of a reference, or a name of an array. If the reference is to blank cells or is invalid, no items are displayed in the list.

The initial/result column contains the number of the selected list item. The first item in the list is number 1, and so on. If the initial/result column contains #N/A, the initial value is taken from the preceding text edit box. If the initial/result column is blank, number 1 is assumed. If you type text in the edit box that is not in the list, the text is returned in the initial/result column of the edit box.