ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   After Print event (https://www.excelbanter.com/excel-programming/327889-after-print-event.html)

No Name

After Print event
 
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[_5_]

After Print event
 
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

Bob Phillips[_6_]

After Print event
 
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.




Tom Ogilvy

After Print event
 
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_]

After Print event
 
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


All times are GMT +1. The time now is 04:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com