Solved

Creating a time delay in VBA code

Posted on 2004-10-04
2
1,040 Views
Last Modified: 2013-12-25
Hi there,

I was trying to get a time delay inserted in the execution of my VBA code. Is there a command which exists wherein we could say like execute the code ahead only after a pause of some 'x' seconds.

Cheers
Goel
0
Comment
Question by:Goels
2 Comments
 
LVL 8

Accepted Solution

by:
bramsquad earned 20 total points
ID: 12220893
place this code at the top of your project

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

then you can call the Sleep() function wherever in your code

Sleep(1000) 'this should equal one second

~b
0
 

Author Comment

by:Goels
ID: 12221100
Thanks a lot dear.

Chow Goels
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now