Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Creating a time delay in VBA code

Posted on 2004-10-04
2
Medium Priority
?
1,099 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 60 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
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…
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…
Suggested Courses

636 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