Consulting

Results 1 to 3 of 3

Thread: Solved: How can you trigger on when the sheet is printed?

  1. #1
    VBAX Regular
    Joined
    Apr 2008
    Posts
    97
    Location

    Question Solved: How can you trigger on when the sheet is printed?

    I have a sheet that I want to run code after it has been printed.
    It would be great if I could trigger on if it was successfully printed but that might be a reach.

    I looked in the events available in the sheets but do not know?

    Having a "UBF" today
    "user brain failure"

    Thanks all.......

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    An AfterPrint event can be simulated by disabling events in the BeforePrint event,
    firing the print manually, and then doing whatever it is that you wanted afterwards.

    For example, the following example

    [vba]
    Private Sub Workbook_BeforePrint(Cancel As Boolean)
    With ActiveSheet
    Application.EnableEvents = False
    .PrintOut
    Cancel = True
    Application.EnableEvents = True
    'your code
    End With
    End Sub
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    Apr 2008
    Posts
    97
    Location
    Cool......
    Thanks once again DLOV

Posting Permissions

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