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

26

Command Bars

The CommandBars collection is an object contained in the Office Object Model, documented in Appendix C. It contains all the menus, toolbars, and shortcut popup menus that are already built into Excel and the other Office applications, as well as any of those objects that you create yourself. You access commandbars through the CommandBars property of the Application object.

Commandbars were first introduced into Office in Office 97. Excel 5 and 95 supported menu bars and toolbars as separate object types. Shortcut menus, or popups, such as those which appear when you right-click a worksheet cell, were a special type of menu bar. In Excel 97 and later versions, the “command bar” is a generic term that includes menu bars, toolbars, and shortcut menus.

Commandbars contain items that are called controls. When clicked, some controls execute operations, such as Copy. Until we get down to the nuts and bolts, we will refer to these types of controls as commands. There are other controls, such as File, that produce an additional list of controls when clicked. We will refer to these controls as menus.

In this chapter, we will show you how to create and manipulate these useful tools.

Toolbars, Menu Bars, and Popups

The screenshot in Figure 26-1 shows the standard Worksheet menu bar at the top of the Excel window.

The Worksheet menu bar contains menus, such as File and Edit. When you click a menu, you see another list containing commands and menus.

  • Cut and Copy are examples ...
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