Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Test for Excel instance?
Message
De
21/02/2002 06:09:41
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
18/02/2002 18:13:46
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00621712
Message ID:
00623036
Vues:
15
>I am using Excel 2000 automated by VFP7. If I use :-
>
>
>GetObject('','excel.application')
>
>
>if there isn't an existing instance of Excel, one is created. If there is an existing instance, a reference to it is returned.
>
>Question: How can I test whether there is already an existing instance of Excel available?
>
>Using Word2000 in the same circumstances, if I use GetObject() and an instance isn't available, I can trap for an OLE error. What about Excel ?
>
>Any ideas ?
>
>TIA
>
>-=Gary

Gary,
I would never suggest using GetObject() with excel (it's sampled in docs but behaviour is not consistent). Even if that works right all the time a new instance is created (unlike word-but IMHO buggy one is word). Use createobject instead. To use the same instance use workbooks collection (add, open).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform