Excel version comparison

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

How can I compare excel versions. I want to say

"every version above 7.999" The problem is sometimes I
get a version = 8.0a

I could parse the number out of the version string, but
I'm thinking there is a "correct" way of doing this.

This thing has to work for Excel95, 97, 2002 and 2003
 
Use something like

Dim Vers As Integer
Vers = Val(Application.Version)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
try this. I just tested in xl95 (vers 7) ,xl97sr2 (vers 8.0a) and xl2002
(vers 10)

Sub WhatVersion()
x = Int(Left(Application.Version, _
Len(Application.Version) - 1))
MsgBox x
End Sub
 
Thanks Chip.

I can't believe I've coded VB for 10 years and haven't
used VAL

I have seen it before, but I just never used it and
didn't remember it.

Again Thanks.
 
MsgBox Val("8.33a")
returns 8.33

if val(application.version) >= 8 then

might be what you want.
 
Back
Top