+ Reply to Thread
Results 1 to 3 of 3

Open specific version of Excel

  1. #1
    Peter T
    Guest

    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.



  2. #2
    Robin Hammond
    Guest

    Re: 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.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

    "Peter T" <peter_t@discussions> wrote in message
    news:ulIk8%[email protected]...
    >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.
    >
    >




  3. #3
    Peter T
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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
    >
    > "Peter T" <peter_t@discussions> wrote in message
    > news:ulIk8%[email protected]...
    > >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.
    > >
    > >

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1