I have the following code to execute BeforePrint event.
Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveSheet.Name = "Print Envelopes" Then
Application.OnTime Now + TimeValue("00:00:05"), ThisWorkbook.Name & "!PrintEnvelopes"
Cancel = True
End If
End Sub
The problem is that I have a print routine within the code to be executed 5 seconds after clicking & the Cancel = True prevents it.
Is there another way to suppress printing without using Cancel = True in the BeforePrint event?
Or is there a way to send the initial output to a dummy printer or something that really does not print?
I want to be able to print via clicking printer Icon or running the code.
Thanks a million. mikeburg
Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveSheet.Name = "Print Envelopes" Then
Application.OnTime Now + TimeValue("00:00:05"), ThisWorkbook.Name & "!PrintEnvelopes"
Cancel = True
End If
End Sub
The problem is that I have a print routine within the code to be executed 5 seconds after clicking & the Cancel = True prevents it.
Is there another way to suppress printing without using Cancel = True in the BeforePrint event?
Or is there a way to send the initial output to a dummy printer or something that really does not print?
I want to be able to print via clicking printer Icon or running the code.
Thanks a million. mikeburg