Creating Class Methods

A method is nothing more than a procedure inside a class module. You can have methods that return a value (function procedures), as well as methods that do not return a value (sub-procedures). Everything you learned about procedures in Chapter 14 applies to methods as well, and you also use the same Insert, Procedure command, and dialog box to create a method. Please refer to Chapter 14 if you need to brush up on the details.

Remember that to be available outside the class, a method must be public, which is the default. To make it available only within the class, to be called from other class methods, change the setting to Private.

You should note the similarity between function methods and Property Get procedures. Both ...

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.