ThaNguyen
07-09-2008, 11:31 AM
I have a small macros that have a couple subs that run together. Here is a sample
Sub daily()
Application.Run "Sales.xls!SalesQuery" -
'Query the sales data based on the criteria entered
Application.Run "Sales.xls!AddToRecord"
End sub
The problem when run the second macros (Application.Run "Sales.xls!AddToRecord") will execute before the SalesQuery is complete.
I used the Application.Wait Now() + TimeValue("00:05:00") between the two codes and it does not work.
Is there a way to make the query is done before execute the next code?
Any help ideas would be greatly appreciated
Thanks
Sub daily()
Application.Run "Sales.xls!SalesQuery" -
'Query the sales data based on the criteria entered
Application.Run "Sales.xls!AddToRecord"
End sub
The problem when run the second macros (Application.Run "Sales.xls!AddToRecord") will execute before the SalesQuery is complete.
I used the Application.Wait Now() + TimeValue("00:05:00") between the two codes and it does not work.
Is there a way to make the query is done before execute the next code?
Any help ideas would be greatly appreciated
Thanks