PDA

View Full Version : Solved: How can you trigger on when the sheet is printed?



slang
12-04-2008, 12:04 PM
I have a sheet that I want to run code after it has been printed.:dunno
It would be great if I could trigger on if it was successfully printed but that might be a reach.:thumb

I looked in the events available in the sheets but do not know?

Having a "UBF" today
"user brain failure":wot

Thanks all.......

Bob Phillips
12-04-2008, 12:28 PM
An AfterPrint event can be simulated by disabling events in the BeforePrint event,
firing the print manually, and then doing whatever it is that you wanted afterwards.

For example, the following example


Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
Application.EnableEvents = False
.PrintOut
Cancel = True
Application.EnableEvents = True
'your code
End With
End Sub

slang
12-05-2008, 07:47 AM
Cool......
Thanks once again DLOV:friends: