View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Alan Beban[_2_] Alan Beban[_2_] is offline
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