View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default preventing printing in Excel

In the VBE go to Tools - VBA Project properties - Protection - Check off
lock from viewing and add a password...
--
HTH...

Jim Thomlinson


"misscrf" wrote:

Interesting discovery. I found this code on an old post:

Private Sub Workbook_BeforePrint(cancel As Boolean)
cancel = True
MsgBox "This page cannot be printed."
End Sub

I put this in, and then protected the worksheet, with autofilter on,
allowing sort and autofilter. The message comes up like it should.
The catch is that if you go to Tools | Macro | VB Editor - you can
delete the code! The code is not protected from being deleted in a
protected workbook!

Wow that is nuts. Just thought I would put this out there.