Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Print Event

  1. #1
    New Member
    Join Date
    Feb 2002
    Location
    Kitchener, Canada
    Posts
    32
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I have a sheet that can only be printed if certain cells have been populated using the before_print event.
    The problem is I want to print preview without needing to fill in all the required fields. The print event and print preview events are one in the same.
    How can I run a piece of code to cancel the event of printing but not for print previewing?

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,959
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    First, take a look at this:

    http://www.mrexcel.com/board/viewtop...ic=466&forum=2

    Then, you should have a public variable that sets to True (Or False) if the Print button was pressed and the oposite if the Print Preview button was pressed.

    Then, in the BeforePrint() event do something like

    If MyVar = True then
    'Check for populated cells
    Else
    'Do nothing, allow to print preview
    End If

    Regards,

    Juan Pablo González
    http://www.juanpg.com

  3. #3
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,959
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Also, I don't think this works in Excel 97.
    Regards,

    Juan Pablo González
    http://www.juanpg.com

  4. #4
    New Member
    Join Date
    Feb 2002
    Location
    Kitchener, Canada
    Posts
    32
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    this will allow the user to print preview. When they are in the preview screen they will be allowed to hit the print button there. This is the thing I'm trying to avoid the most.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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