Cancel Print

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Excel 2003 - this code will still show the print dialog box. Is there anyway
to avoid it?

Public Sub Workbook_BeforePrint(Cancel As Boolean)
MsgBox "No printing for you!"
Cancel = True
End Sub
 
On Windows XP with Excel 2002 or Excel 2003 running...
all I see is the message box, the print dialog box is not shown.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"DG" <[email protected]>
wrote in message
Excel 2003 - this code will still show the print dialog box. Is there anyway
to avoid it?

Public Sub Workbook_BeforePrint(Cancel As Boolean)
MsgBox "No printing for you!"
Cancel = True
End Sub
 
Yes, but if I disable events then I will never see another prompt. So at what
point do I re-enable the events?
 
Disable events for as short a period as you need.
Do what you need to do with the events disabled
Enable events
 
Back
Top