Understanding and identifying objects in VBA
In this recipe, we will learn how to identify objects. Whether you record a macro or manually enter code, you will be working with objects. In essence, the Excel object model is a hierarchy of objects contained in Excel. Each object has certain properties and can be manipulated to perform certain actions in Excel.
Once you understand this hierarchical structure, you will have a good understanding of object-oriented programming (OOP).
Getting ready
As long as you have Excel installed on your system, you have everything you need. You may not have been aware of it, but every time you've used Excel in the past, you've been using objects.
How to do it…
The steps for this recipe are as follows:
- Open a blank workbook in Excel. The first object we're looking at here is the application itself. That's the familiar Excel interface we deal with every time we work in Excel.
- Next, contained in Excel...