Results 1 to 2 of 2
Thread: Printing protection (2003)
2007-02-02, 10:13 #1
- Join Date
- Feb 2004
- Thanked 0 Times in 0 Posts
Printing protection (2003)
How can i protect an Excel sheet for being printed to a printer (PDF or one attached to computer).
Maybe some macro?
2007-02-02, 10:27 #2
- Join Date
- Mar 2002
- Thanked 29 Times in 29 Posts
Re: Printing protection (2003)
Do you mean that you want to disallow users to print a workbook? I don't think it's possible to prevent that 100%. For example, the user could make a screenshot, paste it into Paint and print it.
To make it less easy to print, you can put the following code into the ThisWorkbook module of the workbook:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
MsgBox "Sorry, you cannot print from this workbook", vbInformation
If the user enables macros, this code will prevent the workbook from being printed (or converted to PDF). But if the user disables macros (or if macro security is set to High), the code will not run. To get around that, you could use code to hide all worksheets (except one with a copyright notice or something similar) when the workbook is closed, and unhide them when the workbook is opened. That way, the relevant worksheets will remain hidden if the user disables macros. But clever users will find ways to get around that, too.