Forum Discussion
doevents & application.wait
- Apr 01, 2022
From DoEvents function:
"DoEvents passes control to the operating system. Control is returned after the operating system has finished processing the events in its queue and all keys in the SendKeys queue have been sent."
As a result, macro execution slows down slightly, but it doesn't stop.
On the other hand, from Application.Wait method (Excel):
"The Wait method suspends all Microsoft Excel activity and may prevent you from performing other operations on your computer while Wait is in effect. However, background processes such as printing and recalculation continue."
So a macro comes to a complete standstill during the time specified by Application.Wait.
From DoEvents function:
"DoEvents passes control to the operating system. Control is returned after the operating system has finished processing the events in its queue and all keys in the SendKeys queue have been sent."
As a result, macro execution slows down slightly, but it doesn't stop.
On the other hand, from Application.Wait method (Excel):
"The Wait method suspends all Microsoft Excel activity and may prevent you from performing other operations on your computer while Wait is in effect. However, background processes such as printing and recalculation continue."
So a macro comes to a complete standstill during the time specified by Application.Wait.