checking office (excel) verion from VB

  • Thread starter Thread starter BubBob
  • Start date Start date
B

BubBob

Hi,

How can i check which version of office/excel the computer is running
from Visual Basic? I need this to run different macro for 97 and
2000&XP. Thanks.
 
Try:
Sub check()
MsgBox Application.OperatingSystem ' check system
MsgBox Application.Version ' check version Excel

End Sub
 
Bob,
Hope this helps:

Option Explicit
Private strVersion As String
Sub ThisVersion()

strVersion = Application.Version

Select Case strVersion
Case "8.0"
MsgBox "Excel " & strVersion & " therefore Office 97"
Case "9.0"
MsgBox "Excel " & strVersion & " therefore Office 2000"
Case Else
MsgBox "Excel " & strVersion
End Select

End Sub

Regards,
J
 
Back
Top