how to keep excel file from printing?

T

Tim

I want to be able to lock an excel file so that no one can print it, but they
can view the data. Is there a way to do this?
 
D

dominicb

Good afternoon Tim

Use something like this in the ThisWorkbook pane of the VBE:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
MsgBox "You can't print this spreadsheet"
End Sub

It will stop printing but it won't stop users being able to copy and
paste to another workbook to print, using the PrtScr button to collect
screen dumps etc.

HTH

DominicB
 
Top