Using a Custom Object

After a custom object is properly configured in a class module, it can be referenced from another module. Declare a variable as the custom object type in the declarations section: Dim Employee As clsEmployee

In the procedure, Set the variable to be a New object: Set Employee = New clsEmployee

Continue entering the rest of the procedure. As you refer to the properties and method of the custom object, a tip screen appears, just as with Excel's standard objects (see Figure 20.6).

Figure 20.6

The properties and method of the custom object are just as easily accessible as they are for standard objects.

[(Genera])

d

0 0

Post a comment