Attributes (Visual Basic)


Updated: July 20, 2015

For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

Visual Basic provides several attributes that allow objects interoperate with unmanaged code, and one attribute that enables module members to be accessed without the module name. The following table lists the attributes used by Visual Basic.

ComClassAttributeInstructs the compiler to add metadata that allows a class to be exposed as a COM object.
HideModuleNameAttributeAllows the module members to be accessed using only the qualification needed for the module.
VBFixedArrayAttributeIndicates that an array in a structure or non-local variable should be treated as a fixed-length array.
VBFixedStringAttributeIndicates that a string should be treated as if it were fixed length.