Davers
Well-known Member
- Joined
- Sep 17, 2002
- Messages
- 1,165
I'm having Excel automatically open an application, and then use the SendKeys Method to run a query in the program, and have the query export a document to my desktop, the problem is, the query takes anywhere from 10 seconds, to 10 minutes to run, depending on several factors. Is there a way other than using the Wait Method and specifying a specific length of time, to have Excel wait until the query is finished running and exporting before it goes on to the next part of the code, or key strokes? Here is the pertinent part of the code below....
'Export
SendKeys "%{f}", True
SendKeys "{e 2}", True
SendKeys "~", True
SendKeys "{TAB 8}", True
SendKeys "C:\WINDOWS\Desktop\TRACOutput.xls", True
SendKeys "~ 2", True
KillProcess
End Sub
The KillProcess shuts the program down. It unfortunately shuts the program down immediately. I've tried using SendKeys to use the File Menu to Exit the program, but that runs immediately too....any ideas??
Thanks,
Dave M.
'Export
SendKeys "%{f}", True
SendKeys "{e 2}", True
SendKeys "~", True
SendKeys "{TAB 8}", True
SendKeys "C:\WINDOWS\Desktop\TRACOutput.xls", True
SendKeys "~ 2", True
KillProcess
End Sub
The KillProcess shuts the program down. It unfortunately shuts the program down immediately. I've tried using SendKeys to use the File Menu to Exit the program, but that runs immediately too....any ideas??
Thanks,
Dave M.