simple print loop crashes

K

Ken

I can't figure out why the following code stops executing after each
loop. When I step through the code it works fine. When I run it it
stops execution is interupted after each loop; if I "continue" it
picks up and works fine. Is there something that needs to follow the
PrintPreview (or PrintOut) statement to keep it from interupting?

Sub test2()

For i = 1 To 3

Worksheets(i).PrintPreview

Next i

End Sub

Thanks

Ken
 
D

Don Guillett

printOUT will not stop. printPREVIEW will until you touch the c key or
print. That's what preview means......
 
K

Ken

Don
They both had the exact same behaviour; the code stopped executing
pending my clicking "continue". Previously, the PrintPreview mode
would continue once I clicked "close" on the Excel menu and PrintOut
would run continuously. Somehow it fixed itself when I restrated
Excel. Thanks for taking the time to consider this post and all your
other inputs.
Ken
 
D

Don Guillett

Glad to help. Back when I was racing Formula Fords we had a saying,
"Wiggling works wonders". Guess it works with Excel too.
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
Don
They both had the exact same behaviour; the code stopped executing
pending my clicking "continue". Previously, the PrintPreview mode
would continue once I clicked "close" on the Excel menu and PrintOut
would run continuously. Somehow it fixed itself when I restrated
Excel. Thanks for taking the time to consider this post and all your
other inputs.
Ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top