ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open specific version of Excel (https://www.excelbanter.com/excel-programming/339057-open-specific-version-excel.html)

Peter T

Open specific version of Excel
 
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.



Robin Hammond[_2_]

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.





Peter T

Open specific version of Excel
 
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


"Robin Hammond" wrote in message
...
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.








All times are GMT +1. The time now is 05:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com