Database Reference
In-Depth Information
Figure 14.6b: The Graphical User Interface UserForm Shown in the IDE.
The next screen image has all of the controls for the tool added to the UserForm1 Excel object. This will
look similar to the finished GUI form and will not have the control names in the image. The final tool will
have two of the TextBox objects hidden. These will be used by the VBA code to make the program easier
to code. Note that Figure 14.6b has some notes about the Font, ControlSource, Text values, and the need to
initialize the ComboBox. These notes refer to the Properties window contents. This window shows the
properties for the UserForm. Most of the items on the Properties window can be changed either by typing
over the current value, or right-clicking of the right side of the line item you want to change. We will also
use some VBA code to change some of the ControlSource values to make our coding easier. The following
items are ones we are likely to change for this tool. All of these items can also be changed using VBA code.
1. Name - This property is the name of the control. If you change the object name, then when
referencing the object within the VBA code you should refer to the object (Label1) using the new
label name (like - My_New_Label_Name),
2. Font - The font property allows you to right-click on the property item and select the type face,
font size, and other font items.
3. Text - Information can be typed here to be displayed on the GUI.
4. ControlSource - This property can be set for the cell in a spreadsheet that contains the current
value of the control. No matter how that cell is changed, it will be the current value of the control.
We will use this feature to permit direct updating of the program-unique values (parameters,
program working directly, and the program SAS name) directly into the spreadsheet where this
information is stored.
5. TextAlign - Positions the text on the control (left, right, center).
 
Search WWH ::




Custom Search