Friday, February 24, 2012

Test the Excel version


In Excel Windows we can use this for example to test the version

Sub Test()
    If Val(Application.Version) < 12 Then
        'You use Excel 97-2003
    Else
        'You use Excel 2007 or higher
    End If
End Sub

The Val function will return this

Excel 97 = 8
Excel 2000 = 9
Excel 2002 = 10
Excel 2003 = 11
Excel 2007 = 12
Excel 2010 = 14

Excel 2011 = 14.1 or 14,1

No comments:

Post a Comment