View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_5_] Dave Peterson[_5_] is offline
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