Solved

Creating a time delay in VBA code

Posted on 2004-10-04
2
1,030 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
Comment Utility
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
Comment Utility
Thanks a lot dear.

Chow Goels
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

771 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

10 Experts available now in Live!

Get 1:1 Help Now