Results 1 to 2 of 2
  1. #1
    Lounger
    Join Date
    Feb 2004
    Location
    Romania
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Printing protection (2003)

    Hello!

    How can i protect an Excel sheet for being printed to a printer (PDF or one attached to computer).
    Maybe some macro?

    Thanks.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    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
    End Sub

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •