Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Tom is offline
external usenet poster
 
Posts: 38
Default GetObject-question

Hi

I have installed four Excel versions on my pc (97, 2000, XP & 2003). I have
written an external vba script, that opens an Excel instance. Now I'd like
to test my script with 97, but the script always opens Excel 2003. I'm using
the following comand:

On Error Resume Next
Set oXL = GetObject(, "Excel.Application.8")

If Err.Number < 0 Then
Set oXL = CreateObject("Excel.Application.8")
End If

On Error GoTo 0
oXL.Visible = True

Any ideas how to open Excel 97? Many thanks in advance!

Tom



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default GetObject-question

Use the shell command and point it to the proper executable, then perhaps
you can get a reference to it using the caption. GetObject will always use
the last registered version - so an alternative would be to reregister xl97,
but that probably isn't advisable.

--
Regards,
Tom Ogilvy

"Tom" wrote in message
...
Hi

I have installed four Excel versions on my pc (97, 2000, XP & 2003). I

have
written an external vba script, that opens an Excel instance. Now I'd like
to test my script with 97, but the script always opens Excel 2003. I'm

using
the following comand:

On Error Resume Next
Set oXL = GetObject(, "Excel.Application.8")

If Err.Number < 0 Then
Set oXL = CreateObject("Excel.Application.8")
End If

On Error GoTo 0
oXL.Visible = True

Any ideas how to open Excel 97? Many thanks in advance!

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 2007 Macro/VB Question DDE Question MadDog22 Excel Worksheet Functions 1 March 10th 10 01:47 AM
Controlling Reflection1 from Excel using getObject Michael Nisgore Excel Programming 0 March 3rd 04 03:30 AM
Invoking Excel via Getobject(From Access) to invoke Excel Macro Acie[_2_] Excel Programming 1 February 27th 04 07:56 PM
Is there a better option than Getobject to access a .xls? Dave F[_4_] Excel Programming 4 October 28th 03 02:24 PM
Excel Getobject error Jaya Excel Programming 4 July 17th 03 07:13 PM


All times are GMT +1. The time now is 07:31 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"