Introducing the Excel Object Model

In This Chapter

^ Introducing the concept of objects ^ Finding out about the Excel object hierarchy ^ Understanding object collections ^ Referring to specific objects in your VBA code ^ Accessing or changing an object's properties ^ Performing actions with an object's methods

£veryone is familiar with the word object. Well, folks, forget the definition you think you know. In the world of programming, the word object has a different meaning. You often see it used as part of the expression object-oriented programming, or OOP for short. OOP is based on the idea that software consists of distinct objects that have attributes (or properties) and can be manipulated. These objects are not material things. Rather, they exist in the form of bits and bytes.

In this chapter, I introduce you to the Excel object model, which is a hierarchy of objects contained in Excel. By the time you finish this chapter, you'll have a reasonably good understanding of what OOP is all about — and why you need to understand this concept to become a VBA programmer. After all, Excel programming really boils down to manipulating Excel objects. It's as simple as that.

The material in this chapter may be a bit overwhelming. But please take my advice and plow through it, even if you don't fully grasp it. The important concepts presented here will make lots more sense as you progress through the book.

0 0

Post a comment