+ Reply to Thread
Results 1 to 7 of 7

disable print

  1. #1
    Walter P
    Guest

    disable print

    is it possibilty to disable users from printing a specific worksheet in a
    workbook or for the entire workbook?

  2. #2
    Forum Contributor
    Join Date
    06-01-2006
    Posts
    324
    The easiest is just to put this in your VBA Module:

    Private Sub Workbook_BeforePrint(Cancel As Boolean)
    Cancel = True
    End Sub

    I would put a msgbox in there though, Users gets all weird when things are not working the way it should
    Google is your best friend!

  3. #3
    Valued Forum Contributor
    Join Date
    12-16-2004
    Location
    Canada, Quebec
    Posts
    363
    Hi Walter

    same as beararcade with a message box

    Private Sub workbook_BeforePrint(Cancel As Boolean)
    Cancel = True
    MsgBox "Sorry, you cannot Print from this workbook", vbInformation
    End Sub

  4. #4
    Walter P
    Guest

    Re: disable print

    Thx Bearacade, but can you put it in laments terms for me?

    "Bearacade" wrote:

    >
    > The easiest is just to put this in your VBA Module:
    >
    > Private Sub Workbook_BeforePrint(Cancel As Boolean)
    > Cancel = True
    > End Sub
    >
    >
    > --
    > Bearacade
    >
    >
    > ------------------------------------------------------------------------
    > Bearacade's Profile: http://www.excelforum.com/member.php...o&userid=35016
    > View this thread: http://www.excelforum.com/showthread...hreadid=563438
    >
    >


  5. #5
    Chip Pearson
    Guest

    Re: disable print

    That code needs to go in the ThisWorkbook code module, not a
    regular code module.


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "Bearacade"
    <[email protected]> wrote in
    message
    news:[email protected]...
    >
    > The easiest is just to put this in your VBA Module:
    >
    > Private Sub Workbook_BeforePrint(Cancel As Boolean)
    > Cancel = True
    > End Sub
    >
    >
    > --
    > Bearacade
    >
    >
    > ------------------------------------------------------------------------
    > Bearacade's Profile:
    > http://www.excelforum.com/member.php...o&userid=35016
    > View this thread:
    > http://www.excelforum.com/showthread...hreadid=563438
    >




  6. #6
    Walter P
    Guest

    Re: disable print

    Hey Jetted,

    Sounds good to me, but how do you do what both bearacade and you are saying
    in simplke terms?

    "jetted" wrote:

    >
    > Hi Walter
    >
    > same as beararcade with a message box
    >
    > Private Sub workbook_BeforePrint(Cancel As Boolean)
    > Cancel = True
    > MsgBox "Sorry, you cannot Print from this workbook", vbInformation
    > End Sub
    >
    >
    > --
    > jetted
    > ------------------------------------------------------------------------
    > jetted's Profile: http://www.excelforum.com/member.php...o&userid=17532
    > View this thread: http://www.excelforum.com/showthread...hreadid=563438
    >
    >


  7. #7
    Forum Contributor
    Join Date
    06-01-2006
    Posts
    324
    Quote Originally Posted by Walter P
    Thx Bearacade, but can you put it in laments terms for me?
    Ok.. so open your excel spreadsheet. Go to Tools > Macros > Visual Basic Editor (or you can just press Alt + F11)

    On the left side is the Project Explorer. You should see something with the name VBAProject (Name of your excel file)

    Click it if it is not expanded already, and double click on ThisWorkbook. Put the code in the box that pops up.

    HTH

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1