Detecting Excel 97 using VBA

  • Thread starter Thread starter Casper Hornstrup
  • Start date Start date
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
 
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
(e-mail address removed)------------------------------------------------------
-------------Rosenkrantz Spreadsheet SolutionsWitkopeend 241423 SN
UithoornNederlandTel :
0297-527511-----------------------------------------------------------------
 
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
 
Back
Top