Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Otto
I'm not too fluent in VBA (nor in english) but I had similar trouble i fixed that way, thanks to code from Leo Heuser : In TWK : Private Sub Workbook_Open() RedefinePrintPreview 'voir proc dans module1 de ce fichier End Sub And in a std module : '=========dans un module standard Public Preview As Boolean Sub RedefinePrintPreview() , May 2001 Dim CBar As CommandBar Dim Found As CommandBarControl For Each CBar In CommandBars Set Found = CBar.FindControl(ID:=109, recursive:=True) If Not Found Is Nothing Then Found.OnAction = "Pre" ' Found.OnAction = "" for default End If Next CBar Preview = False 'Not necessary but informative :-) End Sub Sub Pre() Preview = True ActiveSheet.PrintPreview Preview = False End Sub '=========================== '=============== Sub ResetPrintPreview() Dim CBar As CommandBar Dim Found As CommandBarControl For Each CBar In CommandBars Set Found = CBar.FindControl(ID:=109, recursive:=True) If Not Found Is Nothing Then Found.OnAction = "" 'pour avoir le fonctt par défaut End If Next CBar End Sub '=========================== HTH J@@ Otto Moehrbach wrote: Excel XP & Win XP When I click on File - Print Preview the Workbook_BeforePrint macro I have fires. How can I have it not fire or what code can I put in the macro to prevent execution of the rest of the code? Thanks for your time. Otto |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Workbook_BeforePrint | Excel Programming | |||
Workbook_BeforePrint performs twice ? | Excel Programming | |||
disable print option, not Workbook_BeforePrint | Excel Programming | |||
Workbook_BeforePrint | Excel Programming | |||
Problem - Workbook_BeforePrint | Excel Programming |