Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Aborting from a "Before Print" Event

What i am trying to do is to intercept a User's print instruction, and add a
message box asking a question, and depending upon the answer, either
allowing the Print to proceed, or abort. Unfortunately Exit Sub, End, or
Stop does not prevent execution of the Print command. What line can I
insert in the following to abort the print?

Private Sub Workbook_BeforePrint(Cancel As Boolean)

End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Aborting from a "Before Print" Event

Set the Cancel argument to True

ans=MgBox "Yes or NO",vbYesNO
if ans = vbNo then
Cancel = True
End If

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Hotbird" wrote in message
news:Krtec.15636$4N3.13858@newsfe1-win...
What i am trying to do is to intercept a User's print instruction, and add

a
message box asking a question, and depending upon the answer, either
allowing the Print to proceed, or abort. Unfortunately Exit Sub, End, or
Stop does not prevent execution of the Print command. What line can I
insert in the following to abort the print?

Private Sub Workbook_BeforePrint(Cancel As Boolean)

End Sub




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Why is the "zoom" option grayed out in "print preview?" sschreiber Excel Discussion (Misc queries) 0 November 29th 07 04:42 PM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
In Excel 2003 is there a way to prevent "Save As" and "Print"? lucky2000 Excel Discussion (Misc queries) 3 April 26th 07 02:49 PM
What are the System Tables named "Print Area" & "Print Titles"? Tom Ogilvy Excel Programming 1 August 18th 03 05:38 PM


All times are GMT +1. The time now is 11:07 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"