Hi There,

Thanks in advance for any help. Here is my problem:

I am running a VBA script that opens another application (using appactivate shell.......). The application creates a report and takes a varying amount of time to run. I don't want to use a delay as sometimes it runs the report quickly and other times it takes several minutes. When it becomes idle, I'd like to close it.

I could use the Shell and Wait routine but the window remains open when it has finished processing.

Is there a way that I can tell if the application is no longer busy so I can execute the code to close it(which I know how to do) and then continue on with the rest of the VBA script?

Readystate complete can be used for some things but can it be used for shelled Apps?

I've trawled the net for hours but can't seem to find any answers!

Thanks again.