Enum DeclarationRole
What a member of a class module is there for, when it is not there on its own account.
public enum DeclarationRole
Fields
EntryPoint = 4It is the procedure a run of the project starts with (ProgramEntryPoint): the procedure the project names, or the
Sub Mainof the one standard module that declares one. A run calls it, and the project's code need not. A library project has none.EventHandler = 2It handles an event, which calls it by its name:
- an event of a
WithEventsvariable of the class module, or of a form's control, namedVariableName_EventName(MS-VBAL §5.3.1.8); - an event of a form itself, named for the class its designer hosts (
UserForm_Initialize,Form_Load); - the class's own
InitializeorTerminate: aClass_InitializeorClass_Terminatesubroutine with no parameters, of a class module that is not a form (MS-VBAL §5.3.1.10); - an event of a document module's host class, named for that class (
Workbook_Open,Worksheet_Change), which the host application raises.
- an event of a
InterfaceImplementation = 1It implements a member of an interface the class module
Implements, by being namedInterfaceName_MemberName(MS-VBAL §5.3.1.9).None = 0A member like any other, or one whose role the pass could not tell.
UnmatchedEventHandler = 3It is named as the handler of an event of one of a form's controls (
TextBox1_Change), and does not match the event: it is not a subroutine, or its parameter list is not compatible with the event's. MS-VBA compiles it, and the event never calls it: it is dead code, unless the module's own code calls it as the procedure it also is.