Creating Class Properties

A class property requires two or three separate elements to be functional. These are as follows:

  • A variable in the class module where the value of the property is kept.

  • A Property Get procedure that lets code outside the class retrieve the value of the property. Property Get procedures are functions that return a value.

  • A Property Let procedure that lets code outside the class set the value of the property. If the property is an object reference, you'll use a Property Set procedure instead. The Property Let (or Set) procedure is optional and will be omitted if you want to create a read-only property (one that can be read, but not set from outside the class).

Why do you need property procedures to create a property? It ...

Get Office® XP Development with VBA now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.