View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Robin Hammond[_2_] Robin Hammond[_2_] is offline
external usenet poster
 
Posts: 575
Default Open specific version of Excel

You can use the clsid to try the different versions.

Untested, but it would go something like this

Dim oXL as object

'excel 10, clsid from
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Excel.Applicat ion\CLSID
on error resume next
Set oXL = GetObject("clsid:00024500-0000-0000-C000-000000000046")
on error goto 0
if not oXL is nothing then msgbox "excel 10 installed"
set oXL = nothing

Robin Hammond
www.enhanceddatasystems.com

"Peter T" <peter_t@discussions wrote in message
...
I want to get or create a referenced instance of all other versions of
Excel
that might exist, besides the current running version.

Set xl = CreateObject("Excel.Application.8")

The above picks up the default version, not necessarily XL97.

I can get full path's to Excel.exe versions by reading the registry from
...Office\version\Excel\InstallRoot\
but following fails entirely (even if an instance of the version in sPath
is
running).

Set xl = Getobject(sPath & "Excel.exe")

Any ideas appreciated,
Peter T

PS, this question has been asked before but not answered, at least not
that
I've been able to find.