T
Tom Antola
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
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