0

VBA Wait and Sleep Functions In Excel 2010

Wait and sleep functions are used for pausing the running phases of a program for a certain amount of time on Visual Basic (VBA). Employing this function to pause a running project can also result in suspension of working of Microsoft Excel; nevertheless, other operations of your computer continue running.

Sleep Function and Windows:

Sleep function is a sub-function of Windows. It is included with DLL files of Windows. It is used in VBA to temporarily suspend a VBA operation; nonetheless, it is not a function of VBA.

VBA Wait and Sleep Function

Importance of Wait and Sleep Functions:

As mentioned above, this function is employed for pausing an incomplete process or program. If you are looking to search data on an external database to complete the process, but the running phase of the program is not allowing you to do so, then you can use this function to pause the program and can go to collect data.

After returning, you can run the program from the point where you left. You can take as much time as you want to collect your data or to perform any of your other obligations. Hence, this function assists you to complete your project with relieve.

Dissimilarities amid of these Functions:

Although both these functions perform same operations however, there are some differences in their features. Unlike WF, you can assign time to Sleep Function in milliseconds too. On the other hand, WF accepts timings that are equal to or greater than 1 second.

Exceltimes

Leave a Reply

Your email address will not be published. Required fields are marked *