ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Error from printing to fast (https://www.excelbanter.com/excel-programming/422922-error-printing-fast.html)

gtslabs

Error from printing to fast
 

I am using the following command to print worksheets in a loop:

Worksheets(wsname).printout

When I step thru my code it works fine but when I run it at full speed
it causes Excel to crash.
Is there an alternative to this statement that requires no user
response but waits for the print to happen before the code continues?

JLGWhiz

Error from printing to fast
 
You could try using a delay to let the communication between the CPU and the
Printer take place to download the print file for each print job. Usually
the problem is either the printer does not have sufficient memomory or the
buffers are not dumping fast enough and VBA decides it cannot do the job.
Here is a snippet that will delay for 1 second. If you put this immediiately
after your print command it might do the trick. You can increase or decrease
the time by changing the number after the plus sign. It will go as low as .1
seconds.

s = Timer + 1
Do While Timer < s
DoEvents
Loop





"gtslabs" wrote:


I am using the following command to print worksheets in a loop:

Worksheets(wsname).printout

When I step thru my code it works fine but when I run it at full speed
it causes Excel to crash.
Is there an alternative to this statement that requires no user
response but waits for the print to happen before the code continues?



All times are GMT +1. The time now is 03:33 PM.

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