Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I used BeforePrint event to activate multiple sheets in a
document, so every time someone tries to print, all pages are included. After the print job is done, I want Sheet1 to be the only active sheet. In other words, I want the activesheets to go from multiple sheets to one sheet, but since there is no AfterPrint event, I am not sure how to handle this. Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can use application.ontime to call another routine after a little bit.
Option Explicit Private Sub Workbook_BeforePrint(Cancel As Boolean) 'your print routine Worksheets.Select '?? Application.OnTime Now + TimeSerial(0, 0, 3), "AfterPrint" End Sub And in a general module: Option Explicit Sub AfterPrint() Worksheets("Sheet1").Select End Sub Chip Pearson explains ontime at: http://www.cpearson.com/excel/ontime.htm wrote: I used BeforePrint event to activate multiple sheets in a document, so every time someone tries to print, all pages are included. After the print job is done, I want Sheet1 to be the only active sheet. In other words, I want the activesheets to go from multiple sheets to one sheet, but since there is no AfterPrint event, I am not sure how to handle this. Thanks. -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Seems a little flaky.
Why not just disable events print the sheets cancel the print triggering the beforeprint ' select a single sheet if selection was used to print enable events. -- Regards, Tom Ogilvy "Dave Peterson" wrote in message ... You can use application.ontime to call another routine after a little bit. Option Explicit Private Sub Workbook_BeforePrint(Cancel As Boolean) 'your print routine Worksheets.Select '?? Application.OnTime Now + TimeSerial(0, 0, 3), "AfterPrint" End Sub And in a general module: Option Explicit Sub AfterPrint() Worksheets("Sheet1").Select End Sub Chip Pearson explains ontime at: http://www.cpearson.com/excel/ontime.htm wrote: I used BeforePrint event to activate multiple sheets in a document, so every time someone tries to print, all pages are included. After the print job is done, I want Sheet1 to be the only active sheet. In other words, I want the activesheets to go from multiple sheets to one sheet, but since there is no AfterPrint event, I am not sure how to handle this. Thanks. -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That's an alternative, too <bg.
Tom Ogilvy wrote: Seems a little flaky. Why not just disable events print the sheets cancel the print triggering the beforeprint ' select a single sheet if selection was used to print enable events. -- Regards, Tom Ogilvy "Dave Peterson" wrote in message ... You can use application.ontime to call another routine after a little bit. Option Explicit Private Sub Workbook_BeforePrint(Cancel As Boolean) 'your print routine Worksheets.Select '?? Application.OnTime Now + TimeSerial(0, 0, 3), "AfterPrint" End Sub And in a general module: Option Explicit Sub AfterPrint() Worksheets("Sheet1").Select End Sub Chip Pearson explains ontime at: http://www.cpearson.com/excel/ontime.htm wrote: I used BeforePrint event to activate multiple sheets in a document, so every time someone tries to print, all pages are included. After the print job is done, I want Sheet1 to be the only active sheet. In other words, I want the activesheets to go from multiple sheets to one sheet, but since there is no AfterPrint event, I am not sure how to handle this. Thanks. -- Dave Peterson -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Have you tried to simply activate one sheet after the printout statement in
that event? -- HTH RP (remove nothere from the email address if mailing direct) wrote in message ... I used BeforePrint event to activate multiple sheets in a document, so every time someone tries to print, all pages are included. After the print job is done, I want Sheet1 to be the only active sheet. In other words, I want the activesheets to go from multiple sheets to one sheet, but since there is no AfterPrint event, I am not sure how to handle this. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Print a range when an event happens | Excel Discussion (Misc queries) | |||
print event | Excel Programming | |||
Aborting from a "Before Print" Event | Excel Programming | |||
before print event not working | Excel Programming | |||
OnTime event not firing in Workbook_Open event procedure | Excel Programming |