Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting Excel being open
Message
From
18/10/2006 11:47:25
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Detecting Excel being open
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01162978
Message ID:
01162978
Views:
58
Sorry to keep asking Q's friends. Maybe one day soon I'll be an automation wizard buit at the moment I'm on the steep bit of the curve.

It's a good idea to close the Excel app after creating and manipulating a w/b or sheet., otherwise Excel.exe remains as a process but only shows up in the Task Manager, and if you try to create another incidence you can get a dispatch error over the contention (something like that anyway).

You create the w/s and open it for the user to inspect

But there are 2 scenarios:

a) the user looks at it and closes, either the workbook (leaving the Excel shell), or Excel proper
b) they look at it and go back to the VFP app window, without closing

In case a), attempting to close Excel, from the VFP code causes an error.
In case b), you can get the above mentioned dispatch error if try to do another export in the same VFP session.

So 'twould be nice to ascertain whether or not an incidence of Excel is running before deciding what to do.

How to do this please?

'ppreciate it

Terry
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Next
Reply
Map
View

Click here to load this message in the networking platform