WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Killing and Terminating Apps

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Detecting when an App Completes Saving File

Keywords:    fileexist==0

Question:

Using a WinBatch script I load up and save a large Excel file (700k+). I would like to detect when Excel completes the save before continuing. I have been using the TimeDelay statement but I'm wondering if there is a better way. Can I tell when the cursor changes from an hourglass icon to an arrow, indicating the processor is free for more work?

Answer:

One cute trick is to check the file size. The filesize is zero until the save is complete.

Something like:

	;Start file save
	SendKeysTo("~Excel","!fs")
	While FileSize("c:\xxx\yyy.xls")==0
	   TimeDelay(1)
	endWhile

You might also use the Control Manager Extender and the cGetWndCursor to inspect an application's mouse cursor.


Article ID:   W13146
Filename:   Detect when App Finishes Saving File.txt
File Created: 2001:01:15:15:15:12
Last Updated: 2001:01:15:15:15:12