PAUSING A MACRO

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
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.
 
Upvote 0
Use the "Wait" command. e.g. to stick in a 10 second pause:

<pre>
Application.Wait(Now + TimeValue("0:00:10")) </pre>
 
Upvote 0
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 !
 
Upvote 0
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. :biggrin: :biggrin:
 
Upvote 0
fyi - i had a similar problem, and using application.wait as you wrote did work for me.
 
Upvote 0

Forum statistics

Threads
1,213,567
Messages
6,114,342
Members
448,570
Latest member
rik81h

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top