Technorati label: VBA, static member variable, static
First, we declare that all of the following discussions are specific to VBA.
A static member variable of a class refers to such a member variable: any changes made to this member variable by an instance of the class will be accessed by other instances of the class, or, all instances of the class share this variable.
Static member variables are not supported in VBA. If you add static variables before the declaration statement of member variables in the class module of the VBE environment, VBE will automatically hide them.
You can declare static functions in the class module. However, this function is static only for instances of a single class, but different class instances are not ventilated with each other. For example, if a static function is declared so that each time it runs, the local variable is added with 1. for instance A, the value of this local variable will gradually accumulate; for the newly declared instance B, the value of this local variable starts from scratch and accumulates again; they do not affect each other.
That is to say, the VBA class does not support the previously defined static member variable concept.