Tutorial by Examples

VB_Name specifies the class or module name. Attribute VB_Name = "Class1" A new instance of this class would be created with Dim myClass As Class1 myClass = new Class1
In VBA, this attribute is ignored. It was not ported over from VB6. In VB6, it creates a Default Global Instance of the class (a "shortcut") so that class members can be accessed without using the class name. For example, DateTime (as in DateTime.Now) is actually part of the VBA.Conversio...
This attribute is ignored. It was not ported over from VB6. In VB6, it was used in combination with the VB_Exposed attribute to control accessibility of classes outside of the current project. VB_Exposed=True VB_Creatable=True Would result in a Public Class, that could be accessed from other ...
Creates a Global Default Instance of a class. The default instance is accessed via the name of the class. Declaration VERSION 1.0 CLASS BEGIN MultiUse = -1 'True END Attribute VB_Name = "Class1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_Pr...
Controls the instancing characteristics of a class. Attribute VB_Exposed = False Makes the class Private. It cannot be accessed outside of the current project. Attribute VB_Exposed = True Exposes the class Publicly, outside of the project. However, since VB_Createable is ignored in VBA, inst...
Adds a text description to a class or module member that becomes visible in the Object Explorer. Ideally, all public members of a public interface / API should have a description. Public Function GiveMeATwo() As Integer Attribute GiveMeATwo.VB_Description = "Returns a two!" ...
VB_VarUserMemId (for module-scope variables) and VB_UserMemId (for procedures) attributes are used in VBA mostly for two things. Specifying the default member of a class A List class that would encapsulate a Collection would want to have an Item property, so the client code can do this: For i = 1...

Page 1 of 1