Detecting Excel 97 using VBA

C

Casper Hornstrup

Hi. I need to detect, in a VBA script, if it is executed by Excel 97. How do
I do that?

Casper
 
M

Mark Rosenkrantz

Casper;
MsgBox "Welcome to Microsoft Excel version " & _
Application.Version & " running on " & _
Application.OperatingSystem & "!"Shows the version number in a
messagebox Mark.-- Meer Excel ? www.rosenkrantz.nl of
[email protected]------------------------------------------------------
-------------Rosenkrantz Spreadsheet SolutionsWitkopeend 241423 SN
UithoornNederlandTel :
0297-527511-----------------------------------------------------------------
 
O

OZ

Casper Hornstrup said:
Hi. I need to detect, in a VBA script, if it is executed by Excel 97. How do
I do that?

Casper

Try this:

Sub WhatVersion()
Dim Isit97 As String
Isit97 = Application.Version
'MsgBox Isit97
If Val(Isit97) < 9 Then
' Put in code for Excel 97 here...
Else
' this is for Excel 2000 and above....
End If
End Sub
 
Top