Solved

Creating a time delay in VBA code

Posted on 2004-10-04
2
1,073 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Using "ScreenUpdating" 6 84
Automatic Email Reminder 4 74
Formula problem with Excel attachment 6 43
Collapse and expand table in Word 2010 2 101
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

749 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