Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel.Application Instantiating Different Versions

All,

I have a computer that has multiple versions of MS Excel. How can I
instantiate and automate a specific version?

I've tried several attempts using the late bound functions, CreateObject and
GetObject, but no matter what, I always instantiate the current version.
Here is a sample of what I tried

Dim obj as Object
Set obj = CreateObject("Excel.Application.10")
MsgBox obj.Version
Set obj = Nothing

This code always instantiate the current version in the registry. I suppose
I could modify the current version in the registry before instantiating
Excel but I would rather not have to do that. I would much rather have
something that reads like this pseudo code:

Dim obj as Object
If (VersionNeeded = 8) Then
Set obj = CreateObject("Excel.Application.8")
ElseIf (VersionNeeded = 9) Then
Set obj = CreateObject("Excel.Application.9")
ElseIf (VersionNeeded = 10) Then
Set obj = CreateObject("Excel.Application.10")
EndIf
MsgBox obj.Version
Set obj = Nothing

Can anyone help me?

Thank you,
Tom


Reply
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
excel versions rw1204 Excel Discussion (Misc queries) 4 May 13th 10 11:00 AM
Versions - Is it available in Excel? Denise Excel Discussion (Misc queries) 2 September 5th 07 06:38 PM
excel versions miyuki Setting up and Configuration of Excel 4 October 2nd 06 02:11 PM
Please include fonts from previous versions ('98) in new versions JJBQ Excel Discussion (Misc queries) 3 October 8th 05 07:19 PM
Excel Versions neilcounter Excel Discussion (Misc queries) 5 June 1st 05 11:30 PM


All times are GMT +1. The time now is 07:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"