Compiler Constants

Microsoft Visual Basic Constants

Compiler Constants

   

Visual Basic for Applications defines constants for exclusive use with the #If...Then...#Else directive. These constants are functionally equivalent to constants defined with the #If...Then...#Else directive except that they are global in scope; that is, they apply everywhere in a project.

On 16-bit development platforms, the compiler constants are defined as follows:

Constant Value Description
Win16 True Indicates development environment is 16-bit.
Win32 False Indicates that the development environment is not 32-bit.

On 32-bit development platforms, the compiler constants are defined as follows:

Constant Value Description
Vba6 True Indicates that the development environment is Visual Basic for Applications, version 6.0.
Vba6 False Indicates that the development environment is not Visual Basic for Applications, version 6.0.
Win16 False Indicates that the development environment is not 16-bit.
Win32 True Indicates that the development environment is 32-bit.
Mac False Indicates that the development environment is not Macintosh.
Win16 False Indicates that the development environment is not 16-bit.
Win32 False Indicates that the development environment is 32-bit Windows.
Mac True Indicates that the development environment is Macintosh.

Note   These constants are provided by Visual Basic, so you cannot define your own constants with these same names at any level.