PDA

View Full Version : [SOLVED:] How to identify my version of VBA



El_Diabolo
09-16-2013, 10:08 AM
Hi All,

Probably a stupid question, but here goes....

I am running Windows 8, Excel 2010: how can I identify the version of VBA I am using?(e.g. VB6).

Thank you.

Paul_Hossler
09-16-2013, 10:28 AM
I found what I use in the online help -- search for 'Compiler Constants'




Sub WhatVersion()
#If Win64 Then
#If VBA6 Then
MsgBox "64 bit and VBA v6.0 compatible"
#ElseIf VBA7 Then
MsgBox "64 bit and VBA v7.0 compatible"
#ElseIf Mac Then
MsgBox "64 bit and Mac"
#End If

#ElseIf Win32 Then
#If VBA6 Then
MsgBox "32 bit and VBA v6.0 compatible"
#ElseIf VBA7 Then
MsgBox "32 bit and VBA v7.0 compatible"
#ElseIf Mac Then
MsgBox "32 bit and Mac"
#End If

#Else
#If VBA6 Then
MsgBox "16 bit and VBA v6.0 compatible"
#ElseIf VBA7 Then
MsgBox "16 bit and VBA v7.0 compatible"
#ElseIf Mac Then
MsgBox "16 bit and Mac"
#End If
#End If
End Sub




Paul

El_Diabolo
09-16-2013, 10:39 AM
Many thanks, Paul That did the trick.