Skip to Main Content
Excel 2003 VBA Programmer's Reference
book

Excel 2003 VBA Programmer's Reference

by Paul T. Kimmel, Stephen Bullen, John Green, Rob Bovey, Robert Rosenberg
July 2004
Beginner content levelBeginner
1176 pages
27h 45m
English
Wrox
Content preview from Excel 2003 VBA Programmer's Reference

10

Adding Controls

As we have already discussed in Chapter 1, you can add two different types of controls to Excel worksheets. You can use ActiveX controls, found on the Control Toolbox toolbar, or the controls from the Forms toolbar. The Forms toolbar is an Excel 5 and Excel 95 feature, and provided controls for the dialog sheets used in those versions, as well as controls that can be embedded in a worksheet or chart. Dialog sheets have been superseded by UserForms since the release of Excel 97, and UserForms utilize the ActiveX controls.

The Toolbars

The Forms toolbar controls, shown in Figure 10-1, and dialog sheets are still supported in Excel, however. The Forms toolbar controls even have some advantages over the ActiveX controls.

images

Figure 10-1

The Forms controls are less complex than the ActiveX controls and, if you want to place controls on a chart sheet, you can only use the Forms toolbar controls. However, each Forms toolbar control can only respond to a single event. In most cases, that event is the Click event—the edit box is an exception, responding to the Change event.

If you want to create controls and define their event procedures in your VBA code, as opposed to creating them manually, the Forms toolbar controls are easier to work with. A big advantage over an ActiveX control is that the event procedure for a Forms toolbar control can be placed in a standard module, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Excel 2007 VBA Programming with XML and ASP

Excel 2007 VBA Programming with XML and ASP

Julitta Korol
Microsoft® Office Excel 2003 Programming Inside Out

Microsoft® Office Excel 2003 Programming Inside Out

Curtis Frye, Wayne S. Freeze, Felicia K. Buckingham
Excel® 2007 VBA Programmer's Reference

Excel® 2007 VBA Programmer's Reference

John Green, Stephen Bullen, Rob Bovey, Michael Alexander
Access™ 2007 VBA Programmer's Reference

Access™ 2007 VBA Programmer's Reference

Teresa Hennig, Rob Cooper, Geoffrey Griffith, Armen Stein

Publisher Resources

ISBN: 9780764556609Purchase book