Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default 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
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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.





Reply
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 a range when an event happens kefee85 Excel Discussion (Misc queries) 4 February 16th 09 10:42 PM
print event xlcharlie Excel Programming 1 April 19th 05 05:25 PM
Aborting from a "Before Print" Event Hotbird[_2_] Excel Programming 1 April 12th 04 10:52 AM
before print event not working goss[_17_] Excel Programming 2 January 29th 04 03:54 AM
OnTime event not firing in Workbook_Open event procedure GingerTommy Excel Programming 0 September 24th 03 03:18 PM


All times are GMT +1. The time now is 05:36 AM.

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"