Thinking in Terms of Objects

When you are developing applications with Excel (especially when you are dabbling with Visual Basic for Applications - VBA), it's helpful to think in terms of objects, or Excel elements that you can manipulate manually or via a macro. Here are some examples of Excel objects:

■ The Excel application

■ An Excel workbook

■ A worksheet in a workbook

■ A range or a table in a worksheet

■ A ListBox control on a UserForm (a custom dialog box)

■ A chart embedded in a worksheet

■ A particular data point in a chart

You may notice that an object hierarchy exists here: The Excel object contains workbook objects, which contain worksheet objects, which contain range objects. This hierarchy comprises Excel's object model. Excel has more than 200 classes of objects that you can control directly or by using VBA. Other Microsoft Office 2007 products have their own object models.

Note Controlling objects is fundamental to developing applications. Throughout this book, you find out how to automate tasks by controlling Excel's objects, and you do so by using VBA. This concept becomes clearer in subsequent chapters.

4 PREV

NEXT

0 0

Post a comment