ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find Excel Version (https://www.excelbanter.com/excel-programming/345992-find-excel-version.html)

jweasl

Find Excel Version
 
I need an API (I think) to find out the Excel version of the current user.
Based on that information I am going to create different macros.
I made a spreadsheet with a "Sort" button in Excel 2003. One of my users is
on Excel 2000, and it gives them a "variable not defined" error when trying
to run the macro. So I was going to record it in Excel 2000 also, then when
they click sort, figure which version they are running, and select the
appropriate macro.
I'm basically a noob at programming, so any help is appreciated.
Thanks

Chip Pearson

Find Excel Version
 
You can use Application.Version to return the version of Excel.

Select Case CInt(Application.Version)
Case 8 ' 97
Case 9 ' 2000
Case 10 ' 2002
Case 11 ' 2003
Case 12 ' not yet..
End Select



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"jweasl" wrote in message
...
I need an API (I think) to find out the Excel version of the
current user.
Based on that information I am going to create different
macros.
I made a spreadsheet with a "Sort" button in Excel 2003. One of
my users is
on Excel 2000, and it gives them a "variable not defined" error
when trying
to run the macro. So I was going to record it in Excel 2000
also, then when
they click sort, figure which version they are running, and
select the
appropriate macro.
I'm basically a noob at programming, so any help is
appreciated.
Thanks




Ron de Bruin

Find Excel Version
 
Hi jweasl

You can use
If Val(Application.Version) = 9 Then


--
Regards Ron de Bruin
http://www.rondebruin.nl


"jweasl" wrote in message ...
I need an API (I think) to find out the Excel version of the current user.
Based on that information I am going to create different macros.
I made a spreadsheet with a "Sort" button in Excel 2003. One of my users is
on Excel 2000, and it gives them a "variable not defined" error when trying
to run the macro. So I was going to record it in Excel 2000 also, then when
they click sort, figure which version they are running, and select the
appropriate macro.
I'm basically a noob at programming, so any help is appreciated.
Thanks





All times are GMT +1. The time now is 07:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com