Constants module
The Constants module holds the constants of the VBA package that belong to no enumeration, such as vbCrLf, vbNullString and vbObjectError, and lists the package’s enumerations.
Constants
- vbBack
- The backspace character — Chr(8).
- vbCr
- The carriage return character — Chr(13).
- vbCrLf
- The carriage return + linefeed pair — Chr(13) & Chr(10).
- vbFormFeed
- The form feed character — Chr(12).
- vbLf
- The linefeed character — Chr(10).
- vbNewLine
- The platform-appropriate newline character. In twinBASIC, identical to vbCrLf.
- vbNullChar
- The null character — Chr(0).
- vbNullPtr
- A null pointer of type LongPtr (zero), for use with API declarations that take a pointer or handle argument.
- vbNullString
- A null string pointer. Distinct from the zero-length string
""; used when calling external procedures that differentiate between a null pointer and an empty string. - vbObjectError
- The base value for user-defined error numbers — &H80040000 (-2147221504). User-defined error numbers should be greater than this; for example,
Err.Raise vbObjectError + 1000. - vbPtrSize
- The size in bytes of a pointer in the current build, a Long: 4 in a 32-bit build and 8 in a 64-bit build. It is a constant, so it can be used in a constant expression and in an array bound; the size of a LongPtr in the same build. It is not a compiler constant:
#If vbPtrSize = 8 Thenis always false, and conditional compilation tests Win64 instead. - vbTab
- The tab character — Chr(9).
- vbVerticalTab
- The vertical tab character — Chr(11).
Enumerations
- VbAppWinStyle – window style values for the Shell function
- VbArchitecture – processor architecture identifiers
- VbCalendar – calendar type values (Gregorian or Hijri)
- VbCallType – procedure call type values for CallByName
- VbCompareMethod – text comparison modes for string functions
- VbDateTimeFormat – format codes for FormatDateTime
- VbDayOfWeek – day-of-week constants for date functions
- VbFileAttribute – file attribute flags for Dir, GetAttr, and SetAttr
- VbFirstWeekOfYear – first-week-of-year selectors for date functions
- VbIMEStatus – Input Method Editor status values
- VbMsgBoxResult – the values returned by MsgBox
- VbMsgBoxStyle – buttons, icons, and behaviour flags for MsgBox
- VbStrConv – conversion type flags for StrConv
- VbTriState – three-state values used in place of Boolean arguments
- VbVarType – variant subtype codes returned by VarType