Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Excel Version Trap

Hello All,

I am looking for a listing of MS Excel verions (releases). I have searched "all of Microsoft.com" to no avail. Specifically I want to keep a VBA procedure from running if the user has anything less than releases 9.0x or 10.0x. The procedure creates a Pivot Table and Pivot Chart which requires the aforesaid two versions. I was considering using a Select Case statement that would result in an appropriate message box and "Exit Sub" unless a version that handles Pivot Charts is being used. Thanks in Advance!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Excel Version Trap

Hi Amescha,

Possibly, something like:

If CDbl(Application.Version) = 9 Then
'Run your pivot table
Else
'Dont!
End If


---
Regards,
Norman
"amescha" wrote in message
...
Hello All,

I am looking for a listing of MS Excel verions (releases). I have searched

"all of Microsoft.com" to no avail. Specifically I want to keep a VBA
procedure from running if the user has anything less than releases 9.0x or
10.0x. The procedure creates a Pivot Table and Pivot Chart which requires
the aforesaid two versions. I was considering using a Select Case statement
that would result in an appropriate message box and "Exit Sub" unless a
version that handles Pivot Charts is being used. Thanks in Advance!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Excel Version Trap

If Application.Version < "9.0" Then
MsgBox "This utility will not work in your version of Excel. " & _
"You must upgrade to version 9.0.", vbExclamation
End
End If

Gord Dibben Excel MVP

On Fri, 11 Jun 2004 18:38:01 -0700, "amescha"
wrote:

Hello All,

I am looking for a listing of MS Excel verions (releases). I have searched "all of Microsoft.com" to no avail. Specifically I want to keep a VBA procedure from running if the user has anything less than releases 9.0x or 10.0x. The procedure creates a Pivot Table and Pivot Chart which requires the aforesaid two versions. I was considering using a Select Case statement that would result in an appropriate message box and "Exit Sub" unless a version that handles Pivot Charts is being used. Thanks in Advance!


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Excel Version Trap



"Gord Dibben" wrote:

If Application.Version < "9.0" Then
MsgBox "This utility will not work in your version of Excel. " & _
"You must upgrade to version 9.0.", vbExclamation
End
End If

Gord Dibben Excel MVP

Dear Gord,

Well this code works fine on the current platform that I am using, namely excel version 8.0e. I will not have the opportunity to try version 9.0x & 10.0x until next week. Stay tuned.
My question here is that I am given to understand that the application.version
property returns a String. It is obvious that string "values" are being compared here. The question then becomes what happens when I try this on a 10.0x platform. When I type =IF(H3<I3,TRUE,FALSE) on a worksheet and enter 8.0e in cell H3 and 9.0x in cell I3 I see a TRUE but when cell I3 becomes 10.0z or 10 as a number then I see FALSE.
Could you please elaborate if you have the time?
Thanks in advance - again
amescha
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Excel Version Trap

Application.Version returns a numeric, not a string.

It does not differentiate between releases(x,y,z etc.)as far as I can tell.

Sub version()
Range("A1").Value = Application.Version
End Sub

=ISNUMBER(A1) returns TRUE

Tested on versions 8.0, 10.0 and 11.0

Don't know how we got from VBA to worksheet Functions....

Your original question was......

I am looking for a listing of MS Excel verions (releases). I have searched
"all of Microsoft.com" to no avail. Specifically I want to keep a VBA
procedure from running if the user has anything less than releases 9.0x or
10.0x. The procedure creates a Pivot Table and Pivot Chart which requires the
aforesaid two versions. I was considering using a Select Case statement that
would result in an appropriate message box and "Exit Sub" unless a version
that handles Pivot Charts is being used. Thanks in Advance!

Gord




On Sat, 12 Jun 2004 15:26:01 -0700, "amescha"
wrote:



"Gord Dibben" wrote:

If Application.Version < "9.0" Then
MsgBox "This utility will not work in your version of Excel. " & _
"You must upgrade to version 9.0.", vbExclamation
End
End If

Gord Dibben Excel MVP

Dear Gord,

Well this code works fine on the current platform that I am using, namely excel version 8.0e. I will not have the opportunity to try version 9.0x & 10.0x until next week. Stay tuned.
My question here is that I am given to understand that the application.version
property returns a String. It is obvious that string "values" are being compared here. The question then becomes what happens when I try this on a 10.0x platform. When I type =IF(H3<I3,TRUE,FALSE) on a worksheet and enter 8.0e in cell H3 and 9.0x in cell I3 I see a TRUE but when cell I3 becomes 10.0z or 10 as a number then I see FALSE.
Could you please elaborate if you have the time?
Thanks in advance - again
amescha




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Excel Version Trap

I think your test depends on going back to excel's worksheet. And then excel's
parser takes over and sees that entry as numeric.

But if you stay in VBA:
Option Explicit
Sub testme()

Dim myArr As Variant
Dim iCtr As Long
myArr = Array(3.3, "3.3", Application.Version, Val(Application.Version))

Debug.Print "Ctr Val VBA FromWks"
For iCtr = LBound(myArr) To UBound(myArr)
ActiveSheet.Range("a1").Value = myArr(iCtr)
Debug.Print iCtr & "--" & myArr(iCtr) & "--" & TypeName(myArr(iCtr)) _
& "--" & Application.IsNumber(ActiveSheet.Range("a1").Value )
Next iCtr

End Sub
Returned:
Ctr Val VBA FromWks
0--3.3--Double--True
1--3.3--String--True
2--10.0--String--True
3--10--Double--True



Gord Dibben wrote:

Application.Version returns a numeric, not a string.

It does not differentiate between releases(x,y,z etc.)as far as I can tell.

Sub version()
Range("A1").Value = Application.Version
End Sub

=ISNUMBER(A1) returns TRUE

Tested on versions 8.0, 10.0 and 11.0

Don't know how we got from VBA to worksheet Functions....

Your original question was......

I am looking for a listing of MS Excel verions (releases). I have searched
"all of Microsoft.com" to no avail. Specifically I want to keep a VBA
procedure from running if the user has anything less than releases 9.0x or
10.0x. The procedure creates a Pivot Table and Pivot Chart which requires the
aforesaid two versions. I was considering using a Select Case statement that
would result in an appropriate message box and "Exit Sub" unless a version
that handles Pivot Charts is being used. Thanks in Advance!

Gord

On Sat, 12 Jun 2004 15:26:01 -0700, "amescha"
wrote:



"Gord Dibben" wrote:

If Application.Version < "9.0" Then
MsgBox "This utility will not work in your version of Excel. " & _
"You must upgrade to version 9.0.", vbExclamation
End
End If

Gord Dibben Excel MVP

Dear Gord,

Well this code works fine on the current platform that I am using, namely excel version 8.0e. I will not have the opportunity to try version 9.0x & 10.0x until next week. Stay tuned.
My question here is that I am given to understand that the application.version
property returns a String. It is obvious that string "values" are being compared here. The question then becomes what happens when I try this on a 10.0x platform. When I type =IF(H3<I3,TRUE,FALSE) on a worksheet and enter 8.0e in cell H3 and 9.0x in cell I3 I see a TRUE but when cell I3 becomes 10.0z or 10 as a number then I see FALSE.
Could you please elaborate if you have the time?
Thanks in advance - again
amescha


--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Excel Version Trap

Thanks Dave

Over my head, but will look at it and try to decipher.

Gord

On Sun, 13 Jun 2004 05:51:09 -0500, Dave Peterson wrote:

I think your test depends on going back to excel's worksheet. And then excel's
parser takes over and sees that entry as numeric.

But if you stay in VBA:
Option Explicit
Sub testme()

Dim myArr As Variant
Dim iCtr As Long
myArr = Array(3.3, "3.3", Application.Version, Val(Application.Version))

Debug.Print "Ctr Val VBA FromWks"
For iCtr = LBound(myArr) To UBound(myArr)
ActiveSheet.Range("a1").Value = myArr(iCtr)
Debug.Print iCtr & "--" & myArr(iCtr) & "--" & TypeName(myArr(iCtr)) _
& "--" & Application.IsNumber(ActiveSheet.Range("a1").Value )
Next iCtr

End Sub
Returned:
Ctr Val VBA FromWks
0--3.3--Double--True
1--3.3--String--True
2--10.0--String--True
3--10--Double--True



Gord Dibben wrote:

Application.Version returns a numeric, not a string.

It does not differentiate between releases(x,y,z etc.)as far as I can tell.

Sub version()
Range("A1").Value = Application.Version
End Sub

=ISNUMBER(A1) returns TRUE

Tested on versions 8.0, 10.0 and 11.0

Don't know how we got from VBA to worksheet Functions....

Your original question was......

I am looking for a listing of MS Excel verions (releases). I have searched
"all of Microsoft.com" to no avail. Specifically I want to keep a VBA
procedure from running if the user has anything less than releases 9.0x or
10.0x. The procedure creates a Pivot Table and Pivot Chart which requires the
aforesaid two versions. I was considering using a Select Case statement that
would result in an appropriate message box and "Exit Sub" unless a version
that handles Pivot Charts is being used. Thanks in Advance!

Gord

On Sat, 12 Jun 2004 15:26:01 -0700, "amescha"
wrote:



"Gord Dibben" wrote:

If Application.Version < "9.0" Then
MsgBox "This utility will not work in your version of Excel. " & _
"You must upgrade to version 9.0.", vbExclamation
End
End If

Gord Dibben Excel MVP

Dear Gord,

Well this code works fine on the current platform that I am using, namely excel version 8.0e. I will not have the opportunity to try version 9.0x & 10.0x until next week. Stay tuned.
My question here is that I am given to understand that the application.version
property returns a String. It is obvious that string "values" are being compared here. The question then becomes what happens when I try this on a 10.0x platform. When I type =IF(H3<I3,TRUE,FALSE) on a worksheet and enter 8.0e in cell H3 and 9.0x in cell I3 I see a TRUE but when cell I3 becomes 10.0z or 10 as a number then I see FALSE.
Could you please elaborate if you have the time?
Thanks in advance - again
amescha


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel Version Trap

? application.Version
8.0e

--
Regards,
Tom Ogilvy

"Dave Peterson" wrote in message
...
I think your test depends on going back to excel's worksheet. And then

excel's
parser takes over and sees that entry as numeric.

But if you stay in VBA:
Option Explicit
Sub testme()

Dim myArr As Variant
Dim iCtr As Long
myArr = Array(3.3, "3.3", Application.Version,

Val(Application.Version))

Debug.Print "Ctr Val VBA FromWks"
For iCtr = LBound(myArr) To UBound(myArr)
ActiveSheet.Range("a1").Value = myArr(iCtr)
Debug.Print iCtr & "--" & myArr(iCtr) & "--" &

TypeName(myArr(iCtr)) _
& "--" & Application.IsNumber(ActiveSheet.Range("a1").Value )
Next iCtr

End Sub
Returned:
Ctr Val VBA FromWks
0--3.3--Double--True
1--3.3--String--True
2--10.0--String--True
3--10--Double--True



Gord Dibben wrote:

Application.Version returns a numeric, not a string.

It does not differentiate between releases(x,y,z etc.)as far as I can

tell.

Sub version()
Range("A1").Value = Application.Version
End Sub

=ISNUMBER(A1) returns TRUE

Tested on versions 8.0, 10.0 and 11.0

Don't know how we got from VBA to worksheet Functions....

Your original question was......

I am looking for a listing of MS Excel verions (releases). I have

searched
"all of Microsoft.com" to no avail. Specifically I want to keep a VBA
procedure from running if the user has anything less than releases 9.0x

or
10.0x. The procedure creates a Pivot Table and Pivot Chart which

requires the
aforesaid two versions. I was considering using a Select Case statement

that
would result in an appropriate message box and "Exit Sub" unless a

version
that handles Pivot Charts is being used. Thanks in Advance!

Gord

On Sat, 12 Jun 2004 15:26:01 -0700, "amescha"
wrote:



"Gord Dibben" wrote:

If Application.Version < "9.0" Then
MsgBox "This utility will not work in your version of Excel. "

& _
"You must upgrade to version 9.0.", vbExclamation
End
End If

Gord Dibben Excel MVP

Dear Gord,

Well this code works fine on the current platform that I am using,

namely excel version 8.0e. I will not have the opportunity to try version
9.0x & 10.0x until next week. Stay tuned.
My question here is that I am given to understand that the

application.version
property returns a String. It is obvious that string "values" are being

compared here. The question then becomes what happens when I try this on a
10.0x platform. When I type =IF(H3<I3,TRUE,FALSE) on a worksheet and enter
8.0e in cell H3 and 9.0x in cell I3 I see a TRUE but when cell I3 becomes
10.0z or 10 as a number then I see FALSE.
Could you please elaborate if you have the time?
Thanks in advance - again
amescha


--

Dave Peterson



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel Version Trap

Try:
if application.version 8.0 then exit sub

I'm not sure if it works, though
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel Version Trap

Let me repost it:

If application.version < 9 then exit sub
call PVT
..
..
..
..
..
Sub PVT()
'you put your Pivot Table and Pivot Chart things here
'in a seperate Sub
'Because if you include Pivot things up, then Excel 97
wouldn't run
End Sub


  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Excel Version Trap

Be careful here folks. Application.Version returns a String value. Sort
strings and you get a list like
1
10
11
2
20

So for Excel versions:

Sub test()
MsgBox "8.0" < "9.0" 'true
MsgBox "9.0" < "9.0" 'false
MsgBox "10.0" < "9.0" 'true
MsgBox "11.0" < "9.0" 'true
End Sub

HTH. Best wishes Harald


"amescha" skrev i melding
...
Hello All,

I am looking for a listing of MS Excel verions (releases). I have searched

"all of Microsoft.com" to no avail. Specifically I want to keep a VBA
procedure from running if the user has anything less than releases 9.0x or
10.0x. The procedure creates a Pivot Table and Pivot Chart which requires
the aforesaid two versions. I was considering using a Select Case statement
that would result in an appropriate message box and "Exit Sub" unless a
version that handles Pivot Charts is being used. Thanks in Advance!


  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Excel Version Trap



"amescha" wrote:

Hello All,

I am looking for a listing of MS Excel verions (releases). I have searched "all of Microsoft.com" to no avail. Specifically I want to keep a VBA procedure from running if the user has anything less than releases 9.0x or 10.0x. The procedure creates a Pivot Table and Pivot Chart which requires the aforesaid two versions. I was considering using a Select Case statement that would result in an appropriate message box and "Exit Sub" unless a version that handles Pivot Charts is being used. Thanks in Advance!


I have come up with a solution to my own problem, perhaps not the most elegant but it does work on versions 8.0x, 9.0x and 10.0x, the relevant part of the code is:

Dim VersionString As String
Dim VersionNumber As Double
VersionString = Application.Version
VersionNumber = Val(VersionString)
MsgBox "This is MS Excel version " & VersionNumber
If VersionNumber = 9 Then
MsgBox "Go ahead and build your Pivot Chart"
Else
MsgBox "Sorry, this version does not support Pivot Charts!"
Exit Sub
End If

Still I welcome further comment,

amescha
  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default Excel Version Trap

Is there a problem with eliminating VersionString and VersionNumber and
simply using

If Application.Version = 9

Alan Beban

amescha wrote:


"amescha" wrote:


Hello All,

I am looking for a listing of MS Excel verions (releases). I have searched "all of Microsoft.com" to no avail. Specifically I want to keep a VBA procedure from running if the user has anything less than releases 9.0x or 10.0x. The procedure creates a Pivot Table and Pivot Chart which requires the aforesaid two versions. I was considering using a Select Case statement that would result in an appropriate message box and "Exit Sub" unless a version that handles Pivot Charts is being used. Thanks in Advance!



I have come up with a solution to my own problem, perhaps not the most elegant but it does work on versions 8.0x, 9.0x and 10.0x, the relevant part of the code is:

Dim VersionString As String
Dim VersionNumber As Double
VersionString = Application.Version
VersionNumber = Val(VersionString)
MsgBox "This is MS Excel version " & VersionNumber
If VersionNumber = 9 Then
MsgBox "Go ahead and build your Pivot Chart"
Else
MsgBox "Sorry, this version does not support Pivot Charts!"
Exit Sub
End If

Still I welcome further comment,

amescha

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
How do I save an Excel 97-2003 version or 2007 version for Mac 200 Bronigal Excel Discussion (Misc queries) 1 December 7th 09 08:04 AM
Anyone have an Excel template for Skeet /Trap Scores? Ed in Mesquite, TX Excel Discussion (Misc queries) 2 July 16th 06 11:14 AM
Recover earlier version of excel sheet after new version saved? stephanie38 Excel Discussion (Misc queries) 3 June 17th 05 03:52 AM
How can I update the version of Excel 2000 9.0 to version 10.0 Ramsey Can Excel Discussion (Misc queries) 1 May 11th 05 03:28 PM
Trap Excel events from VB pat Excel Programming 0 August 18th 03 11:01 PM


All times are GMT +1. The time now is 03:31 PM.

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

About Us

"It's about Microsoft Excel"