vba6 and vba7 allow to determine if a VBA environment is compatible to the VBA specification 6 or 7. vba7 is true, it implies that vba6 is also true. option explicit
sub main() ' {
#if vba6 then
debug.print "vba6 is defined"
#else
debug.print "vba6 is not defined"
#end if
#if vba7 then
debug.print "vba7 is defined"
#else
debug.print "vba7 is not defined"
#end if
end sub ' }
vba7 constant is especially useful for the conditionally declaring functions with ptrSafe.