LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 204
Default Looking for a 'Close Print Preview' event

Very good, thanks, the on-time solution works a treat.

M

"Héctor Miguel" wrote in message
...
hi, Michelle !

I want to alter a sheet when the user goes into print preview (no problem
with that - I use the BeforePrint event)
But I want to put it back to normal when the user closes print peview.
Is there an event I can use to put it back? - a sort of
'AfterPrintPreview' event...


(AFAIK) *IF* the user goes first into a print preview, '_beforeprint'
event could it be triggered twice
- one when print preview is choosen
- once more *IF* the user chooses *print* from there

also, the print preview (dialog) can be closed either by *cancel* or
*print*, so...
- which one do you think should it be "controlled" ?

(FWIW) you can simulate an '_afterprint' event by using a normal procedure
- called by "OnTime" in '_beforeprint' event (i.e.)

== in ThisWorkbook code module ==
Private Sub Workbook_BeforePrint(Cancel As Boolean)
' do your stuff here, and...
' when the user releases the control (from the dialog) to the
application... '
Application.OnTime Now, "afterprint_macro"
End Sub

== in a standard code module ==
Private Sub AfterPrint_Macro()
' here goes your afterPrint actions ... '
End Sub

hth,
hector.


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Print & Close Buttons in Print Preview grayed-out when '07 script ArielZusya Excel Programming 2 January 16th 09 05:57 PM
Bind Event Prior to Print Preview Corey C.[_2_] Excel Programming 0 May 19th 08 01:56 PM
Handling Print Preview Event Corey C. Excel Programming 0 May 16th 08 08:04 PM
Macro to include Close Print Preview Vic Charts and Charting in Excel 1 January 9th 06 01:06 AM
how to close print preview Lou Allen Excel Worksheet Functions 1 July 24th 05 03:39 AM


All times are GMT +1. The time now is 09:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"