Need VBA code or MACRO to disable the printing of Excel worksheets

  • Thread starter Thread starter Marcello do Guzman
  • Start date Start date
M

Marcello do Guzman

Hi,

Does anyone know the macro or VBA code to disable printing. I want to
prevent users from printing a worksheet. They can edit, view, but
they CANNOT print the contents of a worksheet. Please explain exactly
what I need to do where I place the code and so forth. Your help with
this would be greatly appreciated. Please respond via email to:

(e-mail address removed)

Thanks for any help you may give.
 
Marcello,

In the ThisWorkbook code module ad this code

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Need to note though that this is easily bypassed by simply disabling macros. If
you want to add a further level of protection, you may want to hide the data
they will be looking at, and then have a macro run on opening that unhides it.
That way if they do disable macros they will be able to print but simply won't
see anything *to* print.

Either way, if someonme was determined enough they will be able to print. they
can use ALT+Print Screen to grab it, or one of the commercial packages like
Snagit to grab a screen dump. These will actually grab a print of the entire
scrollable area if they are set to do so, and not just what is on the screen.
 
Back
Top