checking office (excel) verion from VB

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.
 
M

Mark

Try:
Sub check()
MsgBox Application.OperatingSystem ' check system
MsgBox Application.Version ' check version Excel

End Sub
 
J

jason

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top