PAUSING A MACRO
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 6 of 6

Thread: PAUSING A MACRO

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Location
    OKC
    Posts
    98
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    it works great! thanks.

  2. #2
    Board Regular
    Join Date
    Feb 2002
    Location
    OKC
    Posts
    98
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I have a macro that prints many sheets in a workbook. I want to be able to pause the macro for a specified amount of time so the printer buffer doesn't overrun. What line of code can I put in the macro to pause it.

    thanks

    Eddie G.

  3. #3
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Use the "Wait" command. e.g. to stick in a 10 second pause:


    Application.Wait(Now + TimeValue("0:00:10"))


  4. #4
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,959
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Mark, I don't know if it works (I'm just guessing here) because if I remember correctly, the .Wait method pauses the entire application and possibly the system (Again, just guessing).... so, I'm not sure if the computer would still be able to keep processing the job.

    Maybe, a for next that "simulates" the .Wait ? I don't know... maybe it DOES work !
    Regards,

    Juan Pablo González
    http://www.juanpg.com

  5. #5
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I would think that it just pauses the application. You can use it to time keypresses if you ever get desperate enough to use the "SendKeys" command.

    Then again, I'm not going to argue because maybe it doesn't work. I'm sure I've been proved wrong in the past. Just can't remember any specific instances.


  6. #6
    New Member
    Join Date
    Mar 2002
    Posts
    33
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    fyi - i had a similar problem, and using application.wait as you wrote did work for me.

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com