ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   simple print loop crashes (https://www.excelbanter.com/excel-programming/415190-simple-print-loop-crashes.html)

Ken

simple print loop crashes
 
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

Don Guillett

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

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Ken" wrote in message
...
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



Ken

simple print loop crashes
 
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


On Aug 5, 3:04*pm, "Don Guillett" wrote:
printOUT will not stop. printPREVIEW will until you touch the c key or
print. That's what preview means......

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"Ken" wrote in message

...



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- Hide quoted text -


- Show quoted text -



Don Guillett

simple print loop crashes
 

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

"Ken" wrote in message
...
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


On Aug 5, 3:04 pm, "Don Guillett" wrote:
printOUT will not stop. printPREVIEW will until you touch the c key or
print. That's what preview means......

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"Ken" wrote in message

...



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- Hide quoted text -


- Show quoted text -




All times are GMT +1. The time now is 09:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com