Checking a user's version of Excel

tmanger

Board Regular
Joined
Jul 15, 2002
Messages
101
Hello all,

Is there a simple way to check a user's version of Excel on opening the workbook?

For instance, I've been using Excel 2000 and XP for most of my programming. I would like to put a short bit of code in the Open Workbook module that will warn the user if they have an older version of Excel. I've searched the board, but to no avail.

Many thanks.

Tom.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Tom Urtis

MrExcel MVP
Joined
Feb 10, 2002
Messages
11,270
You can use Application.Version like

If Application.Version < 9 Then


XL2000 was version 9 so that's why I used 9 here, per your example.
 

Juan Pablo González

MrExcel MVP
Joined
Feb 8, 2002
Messages
11,959
And you should try using

If Val(Application.Version) < 9 Then

'cause sometimes the Version (which is a string) has more than numbers in it !!
 

Tom Urtis

MrExcel MVP
Joined
Feb 10, 2002
Messages
11,270
Yep, absolutely true, especially with Excel97, which is notorious for many things, testing for that alone would require something like
IF val(application.Version ) = 8 Then

or even more obnoxious, which I use for testing 97:
If Clng(Left(Application.Version,instr(Application.Version,".")-1)) = 8 Then

because in xl97, Application.Version can return something like 8.0e
 

tmanger

Board Regular
Joined
Jul 15, 2002
Messages
101
Thank you all for your suggestions. I'll play around and see if I can make it work.

As always, this board is a godsend.

Tom.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,164
Messages
5,768,561
Members
425,481
Latest member
ihumanl

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top