• Prevent Printing In A Workbook

    If you'd like to prevent anyone from printing your workbook, this code will do the trick (subject to the caveat below).

    Macro Weaknesses
    • If someone disables macros, your code will not run

    Versions Tested:
    These macros have been tested with Excel 2010, but should also work in Excel 97 and higher without any modifications.

    Prevent Printing Any Worksheet In A Workbook:
    The following code will prevent printing any worksheet in the workbook, and goes in the ThisWorkbook module. (If you need help with this, click here.)
    Private Sub Workbook_BeforePrint(Cancel As Boolean)
        Cancel = True
    End Sub


    I'm afraid that you must be logged in to comment or leave a testimonial. I wish it could be otherwise, but I'm trying to keep my site spam free for everyone's benefit. If you don't yet have an account it's completely free to sign up, and a very quick process. Simply click here to Register. Not only can you post a comment here, but it gives you full access to posts questions in our forum as well!


    If you already have an account, and just haven't logged in yet, what are you waiting for? Login Now!