Open specific version of Excel

P

Peter T

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.
 
R

Robin Hammond

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.Application\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
 
P

Peter T

Hi Robin,

Thanks for responding. At first glance that looked very promising. However
it appears that the CLSID value for each version is identical. I have -

HKEY_LOCAL_MACHINE\SOFTWARE\Classes
\Excel.Application\CLSID
\Excel.Application.8\CLSID
\Excel.Application.9\CLSID
etc

each has the same ID string value, namely -
"00024500-0000-0000-C000-000000000046"

I tried the method you suggested in anticipation it would at least get or
create an instance, probably the current version. But it failed completely.

I might be missing something obvious so I will keep looking,

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top