Loading
Ozgrid Excel Help & Best Practices Forums

Excel Video Tutorials / Excel Dashboards Reports



Results 1 to 7 of 7

Thread: VBA Wait method

  1. #1
    Join Date
    24th August 2004
    Posts
    14

    VBA Wait method

    I want excel to wait 2-3 seconds before it calls the next procedure but for some reason, after it calls the first procedure it just gets hung and I have to control break.

    Application.Wait ("00:00:02")

    Any suggestions???

    Excel Video Tutorials / Excel Dashboards Reports


  2. #2
    Join Date
    28th January 2003
    Posts
    3
    The Wait method waits until the time specified. In your case you're asking Excel to wait until it is 2 seconds after midnight before resuming. Try the following:

    Application.Wait (Now() + "00:00:02")

    This tells Excel to wait until 2 seconds have passed from the time the functions is called.

    akhon - Toronto / Ontario / Canada

    Excel Video Tutorials / Excel Dashboards Reports


  3. #3
    Join Date
    15th April 2003
    Location
    USA
    Posts
    7,229
    Wait needs to know the time it is to wait until, not how long to wait. Try
    Application.Wait now+timevalue("00:00:02")

    Excel Video Tutorials / Excel Dashboards Reports


  4. #4
    Join Date
    24th August 2004
    Posts
    14
    I recieve a type mismatch error...

    Excel Video Tutorials / Excel Dashboards Reports


  5. #5
    Join Date
    25th August 2004
    Location
    Philly
    Posts
    17

    Derk's Way works.

    That's a pretty cool feature.

    Excel Video Tutorials / Excel Dashboards Reports


  6. #6
    Join Date
    24th August 2004
    Posts
    14
    thanks for all your help

    Excel Video Tutorials / Excel Dashboards Reports


  7. #7
    Join Date
    29th April 2013
    Posts
    1

    Re: VBA Wait method

    Quote Originally Posted by tratliff View Post
    I recieve a type mismatch error...
    If you are using Option Explicit you´ll get this message. Try to Convert the String Value to Date:


    application.Wait (Now() + CDate("00:00:02"))

    Regards

    Excel Video Tutorials / Excel Dashboards Reports


Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Possible Answers

  1. Wait Until Script Is Finished
    By lidster in forum EXCEL HELP
    Replies: 3
    Last Post: December 23rd, 2006, 00:25
  2. Wait command
    By bbromley in forum EXCEL HELP
    Replies: 12
    Last Post: December 15th, 2005, 21:19
  3. 1/2 a second wait instead of a 1 sec wait
    By ttjolley in forum EXCEL HELP
    Replies: 6
    Last Post: October 2nd, 2004, 05:55
  4. VBA : application .wait
    By lior03 in forum EXCEL HELP
    Replies: 1
    Last Post: April 26th, 2004, 00:39
  5. Please Wait for lengthy Macros
    By Dave Hawley in forum OPEN SOURCE: Hey! That is Cool!
    Replies: 0
    Last Post: March 6th, 2003, 16:20

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
porno