MACRO OR VBA CODE TO PREVENT USERS FROM PRINTING THE CONTENTS OF A WORKSHEET?

  • 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 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,

Put this code in the THisWorkbook code module.

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

In the VB IDE, in the project explorer window, double-click on the
ThisWorkbook object, and when the code pane opens, put that code in it.

--

HTH

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