Working with the Workbook Object

The Workbook OBJECT REPRESENTS a single workbook. Though the Workbook object has many properties and methods, you'll use only a handful on a regular basis. In this chapter, you'll examine these common properties and methods along with a few events associated with the Workbook object.

Many objects have a set of actions to which they've been designed to respond. The actions that an object recognizes are known as events. You can write procedures that execute when an object recognizes that a given event has occurred. For example, the Workbook object has an Open event; whenever a workbook is opened, VBA looks for any code associated with the Open event and executes it.

You'll also look at the Workbooks collection object, known as the Workbooks object. The Workbooks object represents all of the Workbook objects that are open in Excel.

Finally, I'll put together all of the concepts you've learned so far to create a set of procedures that you'll find useful for any process in which you need to apply processing to one or more workbooks.

0 0

Post a comment