Text Documents (Writer)
HTML Documents (Writer Web)
Spreadsheets (Calc)
Presentations (Impress)
Drawings (Draw)
Database Functionality (Base)
Formulae (Math)
Charts and Diagrams
Macros and Scripting
Office Installation
Common Help Topics
OneOffice Logo

Option ClassModule Statement

Specifies that the module is a class module that contains members, properties, procedures and functions.

This statement must be added before the executable program code in a module.

Parameters:

This statement must be used jointly with Option Compatible statement or Option VBASupport 1, the former is enabling VBA compatibility mode, while the latter is enforcing VBA support on top of compatibility.

Syntax:

Option ClassModule

Example:


         Option Compatible
         Option ClassModule
             
         ' Optional members go here
             
         Private Sub Class-Initialize()
             ' Optional construction code goes here
         End Sub ' Constructor
         Private Sub Class-Terminate()
             ' Optional destruction code goes here
         End Sub ' Destructor
             
         ' Properties go here.
             
         ' Procedures & functions go here.