Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When you print preview, the entire macro will be run. If you don't want
something to run, either delete it or move it to another module where you'll use it. "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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Barb
I want the entire macro (it calls another macro) to run when the user issues a print command. I take it then, from what you say, that there is no way to detect that a Print Preview was commanded. Is that right? Thanks for your time. Otto "Barb Reinhardt" wrote in message ... When you print preview, the entire macro will be run. If you don't want something to run, either delete it or move it to another module where you'll use it. "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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm not aware of it, but I've just recently started working with event driven
macros. "Otto Moehrbach" wrote: Barb I want the entire macro (it calls another macro) to run when the user issues a print command. I take it then, from what you say, that there is no way to detect that a Print Preview was commanded. Is that right? Thanks for your time. Otto "Barb Reinhardt" wrote in message ... When you print preview, the entire macro will be run. If you don't want something to run, either delete it or move it to another module where you'll use it. "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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Otto,
I tried writing some code and crashed Excel. Here are some other ways to possible do it ... http://snipurl.com/13du9 -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "Otto Moehrbach" wrote in message 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 |
#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 |
Reply |
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 |