+ Reply to Thread
Results 1 to 3 of 3

Suppress printing workbook

  1. #1
    Registered User
    Join Date
    11-09-2005
    Posts
    10

    Suppress printing workbook

    I currently have the following macro to suppress printing and it almost works perfectly:
    Private Sub Workbook_BeforePrint(Cancel As Boolean)
    Cancel = True
    MsgBox "Information contained in this workbook cannot be printed"
    End Sub

    The problem is that some individuals (who do not have edit privileges) may need to print a worksheet before sending the workbook to the end user (who cannot print anything).

    Those users who have edit privileges are currently using a "lock button" to lock specific cells throughout the workbook from being edited by the end users. Can this print macro be somehow assigned to the same button that I'm using to lock cells? I've tried to do this but it doesn't seem to work. (FYI: If it helps, here is the macro I recorded in a module to lock the cells):
    Sheets("T133B").Select
    Range("A1:M133").Select
    ActiveWindow.ScrollRow = 1
    Selection.Locked = True
    Selection.FormulaHidden = False
    Range("C4:J4").Select
    Sheets("T133A").Select
    Range("C3:M44").Select
    ActiveWindow.ScrollRow = 12
    Selection.Locked = True
    Selection.FormulaHidden = False
    Range("C5").Select
    Sheets("T133A 2nd").Select
    Range("C5:M44").Select
    Selection.Locked = True
    Selection.FormulaHidden = False
    Range("C5").Select
    Sheets("DLO").Select
    ActiveWindow.ScrollRow = 1
    Range("C5:M77").Select
    Selection.Locked = True
    Selection.FormulaHidden = False
    Range("C5").Select
    End Sub

  2. #2
    Tom Ogilvy
    Guest

    Re: Suppress printing workbook

    See one answer in Programming. Please don't multipost as you waste
    people's time answering questions that might have already been answered.
    If you want to post in multiple groups, cross post so that all see the
    answers in each forum.

    --
    Regards,
    Tom Ogilvy

    "zenahs" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I currently have the following macro to suppress printing and it almost
    > works perfectly:
    > Private Sub Workbook_BeforePrint(Cancel As Boolean)
    > Cancel = True
    > MsgBox "Information contained in this workbook cannot be printed"
    > End Sub
    >
    > The problem is that some individuals (who do not have edit privileges)
    > may need to print a worksheet before sending the workbook to the end
    > user (who cannot print anything).
    >
    > Those users who have edit privileges are currently using a "lock
    > button" to lock specific cells throughout the workbook from being
    > edited by the end users. Can this print macro be somehow assigned to
    > the same button that I'm using to lock cells? I've tried to do this
    > but it doesn't seem to work. (FYI: If it helps, here is the macro I
    > recorded in a module to lock the cells):
    > Sheets("T133B").Select
    > Range("A1:M133").Select
    > ActiveWindow.ScrollRow = 1
    > Selection.Locked = True
    > Selection.FormulaHidden = False
    > Range("C4:J4").Select
    > Sheets("T133A").Select
    > Range("C3:M44").Select
    > ActiveWindow.ScrollRow = 12
    > Selection.Locked = True
    > Selection.FormulaHidden = False
    > Range("C5").Select
    > Sheets("T133A 2nd").Select
    > Range("C5:M44").Select
    > Selection.Locked = True
    > Selection.FormulaHidden = False
    > Range("C5").Select
    > Sheets("DLO").Select
    > ActiveWindow.ScrollRow = 1
    > Range("C5:M77").Select
    > Selection.Locked = True
    > Selection.FormulaHidden = False
    > Range("C5").Select
    > End Sub
    >
    >
    > --
    > zenahs
    > ------------------------------------------------------------------------
    > zenahs's Profile:

    http://www.excelforum.com/member.php...o&userid=28681
    > View this thread: http://www.excelforum.com/showthread...hreadid=508994
    >




  3. #3
    Registered User
    Join Date
    11-09-2005
    Posts
    10

    Thanks

    Sorry Tom! I realized after the fact that I had originally posted my question in the wrong spot. Rookie mistake. Won't happen again.

+ 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