Name
Class Statement
Syntax
Class name 'statements End Class
-
name Use: Required
Data Subtype: n/a
The name of the class
Description
Defines a class and delimits the statements that define that class’s member variables, properties, and methods.
Rules at a Glance
namefollows standard Visual Basic variable naming conventions.statementscan consist of the following:Private variable definitions. These variables are accessible within the class but do not have scope outside of the class.
Public variable definitions. (If variables are declared using the
Dimkeyword without an explicit indication definition of their scope, they are Public by default.) These variables become public properties of the class.Public function and subroutines defined with the
Function...EndFunctionorSub...End Substatements. The scope of routines is not explicitly defined using either thePublicorPrivatekeywords; it is public by default. These routines become the public methods of the class.Private function and subroutines defined with the
Function...EndFunctionorSub...End Substatements. They are visible within theClass...End Classcode block, but not to code outside the class.Public properties defined using the
Property Let,Property Get, andProperty Setstatements. Properties defined without an explicitPublicorPrivatestatement are also Public default. They, along with any public variables, form the public properties of the class.
The default member of the class can be defined by specifying the
Default ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access