Re: Cancel Printing Except Q
- From: Dave Peterson <petersod@xxxxxxxxxxxxxxxx>
- Date: Tue, 16 Jan 2007 11:38:28 -0600
You could add some code to disable events (including the _beforeprint event) in
your code that gets/validates the password.
dim myPwd as string
'some validation here
if mypwd = "oktoprint" then
application.enableevents = false
worksheets("whatever").printout
application.enableevents = true
end if
And the _BeforePrint routine won't even run.
Sean wrote:
I have the following code which prevents priniting of a document. Would
it be possible to allow printing if the correct password was entered
within a userform? So on clicking the Print Icon an input box which
required the password would appear, if it is correct, document prints,
if it isn't document doesn't. If so how would I do it?
Thanks
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
End Sub
--
Dave Peterson
.
- Follow-Ups:
- Re: Cancel Printing Except Q
- From: Sean
- Re: Cancel Printing Except Q
- References:
- Cancel Printing Except Q
- From: Sean
- Cancel Printing Except Q
- Prev by Date: Re: Form Checkbox Updating
- Next by Date: Re: Help with work*** protection
- Previous by thread: Cancel Printing Except Q
- Next by thread: Re: Cancel Printing Except Q
- Index(es):
Loading