Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Test for Excel instance?
Message
From
21/02/2002 06:09:41
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
18/02/2002 18:13:46
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00621712
Message ID:
00623036
Views:
16
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform