Page 344 - Microsoft Office Excel 2003 Programming Inside Out
P. 344
Microsoft Office Excel 2003 Programming Inside Out
The class includes a private class-level variable named MyRetailPrice that holds the value for
the RetailPrice property. If the new value for RetailPrice is greater than the WholesaleCost, the
new retail price will be saved in the MyRetailPrice variable.
However, if someone attempts to set the retail price lower than the wholesale cost, the Plant-
Error event will be fired passing the details of the error to the program that owns the object.
In this chapter, you learned how a class is different from an object. In addition, you learned
how to create your own custom classes, including how to define properties, property rou
tines, methods, and events. Some design tips on how to recognize objects, properties, and
methods were also discussed. Finally, you learned how to design several different types of
classes, including a simple class and a collection class, along with how to extend your classes
to include initializing a class and implementing business rules.
Chapter 14
318
Part 4: Advanced VBA