Checking for VBA5, not VBA6

M

Matt Somers

Thanks to Tom Ogilvy, I understand you can check for VBA6 using:

#If VBA6 then

Msgbox "Yes"

#Else

Msgbox "No"

#End if

When I replaced the "VBA6 with "VBA5" in Excel 97, the code returned "No".

Am I properly referencing the version by entering VBA5?
Should I be checking something else? Is it VBA5.0, I don't know.

Thanks,

Matt
 
R

Rob van Gelder

There isn't a compiler constant named VBA5. You can only use VBA6.
In VBA help, do a search for #If, then look under "See Also" for Compiler
Constants
 
T

Tom Ogilvy

What are you trying to differentiate. In the original you wanted separate
code for VBA6 (xl2000 or later) and VBA5 (xl97). The #if statement provides
that separation. It is unclear what additional differentiation you want.
As Rob stated, there is no VBA5 variable that is predefined.
 
M

Matthew Somers

Thanks guys for the answer. That's basically all I needed to know. I
hadn't seen the question addressed directly, so I figured, I would ask.

Matt Somers

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Top