Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I find out Excel is still running

Status
Not open for further replies.

SergeN

Programmer
Sep 15, 2003
1
UA
The problem is:
I send data to Excel using TexcelApplication. After that I (or user) may leave application and Excel and do some other work. After some time user return to my application and try to send to the same Excel report new data.
How can I find out Excel is still running and my report is still opened in it?
TexcelApplication1.ConnectKind := ckNewInstance
 
You can check to see if it's running like this. I don't know how to check for your document.

uses windows;
ExcelWnd:THandle;

ExcelWnd := FindWindow('XLMain', nil);
if ExcelWnd <> 0 then
// Excel is running


Brian
&quot;There are 2 kinds of people in the world, those that divide people into two groups and those that don't. I belong to the second group.&quot; - tag line I stole
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top