Chapter Summary

• Object-oriented programming maps data, structures, and business requirements to objects.

• Encapsulation allows programmers to reduce code complexity by hiding data and complex data structures in classes.

• Class modules contain member variables as well as property and method procedures.

• Class modules do not exist in memory.

• Multiple instances of a single class can be created.

• By default, VBA class modules contain two events called Initialize and Terminate.

• The Initialize event for a class module is triggered each time the class is instantiated (created) using the New or Set keywords.

• The Terminate event is triggered each time the class's instance is removed from memory.

• VBA provides property procedures for managing the attributes of a class.

• VBA provides three types of property procedures: Property Get, Property Let, and Property Set.

• Property Get procedures return the value of a property.

• Property Let procedures assign a value to a property.

• Property Set procedures set the value of an object property.

• Use a single Property Get procedure to create a read-only property.

• Method procedures are created in class modules with Sub and Function procedures.

• Setting objects to Nothing frees system resources.

• Collections are objects that contain an ordered list of items.

• Items in a collection are called members.

• Members in a collection can be referenced with an index or key value.

• VBA provides the For Each loop to iterate through members in a collection or an array.

0 0

Post a comment