Cancel Print

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
 
J

Jim Cone

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
 
G

Guest

Yes, but if I disable events then I will never see another prompt. So at what
point do I re-enable the events?
 
D

Dave Peterson

Disable events for as short a period as you need.
Do what you need to do with the events disabled
Enable events
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top