LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Excel version

Jim,
Seems that this may explain the behaviour:
http://groups.google.co.uk/group/mic...86e198 266b8a

However, I did see a post from Tom:
http://groups.google.co.uk/group/mic...692a3c f63aaf
that this is the normal, although that means that it not possible to
Get/Create version specific objects, which I always thought was possible.

Confused ?

NickHK

"Jim Rech" wrote in message
...
Nick-

but then noticed that I can only see the latest version


When I look at Excel.Application.11 and Excel.Application.12 (I have only
2003 and 2007 installed on this machine) I see the same CLSID for both.
That CLSID (00024500-0000-0000-C000-000000000046) points to Excel 2003 and
when I run Excel.exe from Start-Run that's what I get. So it looks like
whichever version re-registers itself last hogs all the keys.

As a practical matter I think instantiating Excel, as you said, is the way
to go. Although you apparently cannot enumerate through multiple versions
that way, at least you can get the version you will actually get when you
automate Excel, and I think that's all that matters.

Jim

"NickHK" wrote in message
...
Jim,
I was going to suggest just trying to instantiate the version, but then
noticed that I can only see the latest version, which seems strange.
I get this in the Immediate window
Excel version 10.0 is installed.
Excel version 10.0 is installed.

Private Sub CommandButton1_Click()
Dim i As Long
Dim RetVal As Variant

RetVal = GetExcelVersions()

If IsArray(RetVal) Then
For i = LBound(RetVal) To UBound(RetVal)
Debug.Print "Excel version " & RetVal(i) & " is installed."
Next
Else

End If
End Sub

Private Function GetExcelVersions() As Variant
Dim i As Long
Dim ExcelApp As Object
Dim Versions As String

On Error Resume Next
For i = 5 To 15
Set ExcelApp = CreateObject("Excel.Application." & i)
If Not ExcelApp Is Nothing Then
Versions = Versions & ExcelApp.Version & ","
ExcelApp.Quit
Set ExcelApp = Nothing
End If
Next

If Len(Versions) 0 Then
GetExcelVersions = Split(Left(Versions, Len(Versions) - 1), ",")
Else
GetExcelVersions = False
End If

End Function

NickHK

"Jim Rech" wrote in message
...
My concern with registry entries in general is are they removed if the
product is uninstalled? I think Office itself looks to the HKLM keys
such
as HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0.

--
Jim
"NickHK" wrote in message
...
| Eric,
| I have these 2 keys, as I have 2 versions of Office installed:
|
| HKEY_CLASSES_ROOT\Excel.Application.9
| HKEY_CLASSES_ROOT\Excel.Application.10
|
| NickHK
|
| "Eric" wrote in message
| ...
| Hi Gary,
|
| Anything that would work outside Excel?
|
| Eric
|
| "Gary Keramidas" <GKeramidasATmsn.com wrote in message
| ...
| Application.Version
| will return 11 for 2003, 12 for 2007
|
| environ variables i know of for your reference:
|
| ALLUSERSPROFILE
| APPDATA
| CommonProgramFiles
| COMPUTERNAME
| ComSpec
| FP_NO_HOST_CHECK
| HOMEDRIVE
| HOMEPATH
| LOGONSERVER
| NUMBER_OF_PROCESSORS
| OS
| Path
| PATHEXT
| PROCESSOR_ARCHITECTURE
| PROCESSOR_IDENTIFIER
| PROCESSOR_LEVEL
| PROCESSOR_REVISION
| ProgramFiles
| SESSIONNAME
| SystemDrive
| SystemRoot
| TEMP
| TMP
| USERDOMAIN
| USERNAME
| USERPROFILE
| WecVersionForRosebud.828
| windir
|
|
| --
|
|
| Gary
|
|
| "Eric" wrote in message
| ...
| Hello,
|
| I am trying to identify what version of Excel is install on a
system?
| Is
| there an environment variable or a Reg key that would give me
this
| information?
|
| Thank you.
|
| Eric
|
|
|
|
|
|
|
|









 
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
Saving a newer version of Excel using an older version (Excel 97) Alain Dekker Excel Discussion (Misc queries) 7 April 3rd 10 11:02 PM
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
Macro - Save an Open Excel Version 4 as current version of Excel planomax Excel Programming 1 February 6th 07 09:41 PM
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


All times are GMT +1. The time now is 08:22 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"