vba Thinking in Terms of Objects

When you’re developing applications with Excel (especially when you’re 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:
h The Excel application
h An Excel workbook
h A worksheet in a workbook
h A range or a table in a worksheet
h A ListBox control on a UserForm (a custom dialog box)
h A chart embedded in a worksheet
h A chart series in a chart
h 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 products have their own object models.