Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
jim37055
 
Posts: n/a
Default Detecting version of Excel being used


I have a VBA program that I generated in Excel 2003 that will also be
run by users who are still stuck with 97 and 2000. As part of the
program, I generate some pivot tables. The problem is that the code
for generating the pivot tables has to be different for 97 and 2000
users. My current solution is to pop up a message box asking them if
they are using 2003, and if they answer "NO" then I call the code for
generating the pivot tables in 97/2000 format. The problem is that
some of the folks using this program will not know if they are using
2003 or not.

Is there a VBA statement or a function out there that will tell me
automatically what version of Excel the current user is running so that
I do not have to rely on asking them and them actually knowing???


--
jim37055
------------------------------------------------------------------------
jim37055's Profile: http://www.excelforum.com/member.php...o&userid=27788
View this thread: http://www.excelforum.com/showthread...hreadid=473755

  #2   Report Post  
Gary''s Student
 
Posts: n/a
Default

MsgBox "Welcome to Microsoft Excel version " & _
Application.Version & " running on " & _
Application.OperatingSystem & "!"

--
Gary's Student


"jim37055" wrote:


I have a VBA program that I generated in Excel 2003 that will also be
run by users who are still stuck with 97 and 2000. As part of the
program, I generate some pivot tables. The problem is that the code
for generating the pivot tables has to be different for 97 and 2000
users. My current solution is to pop up a message box asking them if
they are using 2003, and if they answer "NO" then I call the code for
generating the pivot tables in 97/2000 format. The problem is that
some of the folks using this program will not know if they are using
2003 or not.

Is there a VBA statement or a function out there that will tell me
automatically what version of Excel the current user is running so that
I do not have to rely on asking them and them actually knowing???


--
jim37055
------------------------------------------------------------------------
jim37055's Profile: http://www.excelforum.com/member.php...o&userid=27788
View this thread: http://www.excelforum.com/showthread...hreadid=473755


  #3   Report Post  
moondark
 
Posts: n/a
Default


Hi there,

In VBA there's a property of -ApplicationObject- called Version.
In Excel 2000 it returns 9.0 for some reason. You'd have to check the
ReturnValues of each Excel version you're interested in somewhere on
the net.
Then an IF-Statement would do, I think.

Code:
--------------------
If(Application.version = "9.0") then call excel2000_code
--------------------

don't forget to insert the following ;)

Code:
--------------------
if(Application.version = "4.0") then msgbox("Phew, you should buy a new version of Excel, me, the little bothering HelpBot, suggests!")

--------------------


Regards,

Simon


--
moondark
------------------------------------------------------------------------
moondark's Profile: http://www.excelforum.com/member.php...o&userid=27390
View this thread: http://www.excelforum.com/showthread...hreadid=473755

  #4   Report Post  
jim37055
 
Posts: n/a
Default


Thanks Simon,

I figured there had to be something like that out there.... I think
our installed base only includes 97, 2000 and 2003 so it should not be
too hard to figure out what values they return.


--
jim37055
------------------------------------------------------------------------
jim37055's Profile: http://www.excelforum.com/member.php...o&userid=27788
View this thread: http://www.excelforum.com/showthread...hreadid=473755

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel not detecting that a file is currently being edited cds_tech Excel Discussion (Misc queries) 1 June 27th 05 09:06 PM
How to use later version Excel file in 4.0a? ajimmo Excel Discussion (Misc queries) 1 May 30th 05 10:26 AM
Transfer "upgrade" version of Excel 97 to a new computer? m0useketeer Excel Discussion (Misc queries) 1 April 14th 05 12:06 AM
other systems detecting excel 4.0 if excel 2000 is installed Tristan_Flynn Setting up and Configuration of Excel 0 January 18th 05 06:55 PM
I cant use englisch function names in a swedich version of excel PE Excel Discussion (Misc queries) 2 December 7th 04 01:00 AM


All times are GMT +1. The time now is 01:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"