• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 8. Understanding Objects > Creating Your Own Objects

Creating Your Own Objects

In addition to using objects from existing libraries, VBA enables you to build your own classes and objects. This section shows you how to build a simple class that represents a weekly timecard summary. To get started, select Insert, Class Module. In the VBA window, an empty class module looks just like an empty regular module. But the Properties window shows that it’s a class module, and you’ll see a different icon in the Project window. Use the Properties window to name the class TimeWeek.

Now enter this code to implement the class:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint