Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Another way to suppress print besides Cancel = True?


I have the following code to execute BeforePrint event.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveSheet.Name = "Print Envelopes" Then
Application.OnTime Now + TimeValue("00:00:05"), ThisWorkbook.Name &
"!PrintEnvelopes"
Cancel = True
End If
End Sub

The problem is that I have a print routine within the code to be
executed 5 seconds after clicking & the Cancel = True prevents it.

Is there another way to suppress printing without using Cancel = True
in the BeforePrint event?

I want to be able to print via clicking printer Icon or running the
code.

Thanks a million. mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=490604

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Another way to suppress print besides Cancel = True?

No, but you can suppress events

Sub PrintEnvelopes()
Application.EnableEvents = False
Activesheet.Printout
Application.EnableEvents = True
End Sub


this might help your recursive calls to ontime as well.
--
Regards,
Tom Ogilvy


"mikeburg" wrote in
message ...

I have the following code to execute BeforePrint event.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveSheet.Name = "Print Envelopes" Then
Application.OnTime Now + TimeValue("00:00:05"), ThisWorkbook.Name &
"!PrintEnvelopes"
Cancel = True
End If
End Sub

The problem is that I have a print routine within the code to be
executed 5 seconds after clicking & the Cancel = True prevents it.

Is there another way to suppress printing without using Cancel = True
in the BeforePrint event?

I want to be able to print via clicking printer Icon or running the
code.

Thanks a million. mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile:

http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=490604



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Another way to suppress print besides Cancel = True?


Thanks for the response. Can't seem to get it to work.

Is there a way to set the output to a dummy printer where nothing
prints?

thanks a million.. mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=490604

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Another way to suppress print besides Cancel = True?

You can use

Activesheet.PrintPreview

--
Regards,
Tom Ogilvy


"mikeburg" wrote in
message ...

Thanks for the response. Can't seem to get it to work.

Is there a way to set the output to a dummy printer where nothing
prints?

thanks a million.. mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile:

http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=490604



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Another way to suppress print besides Cancel = True?


Still prints to the printer once preview is closed.

Any other ideas?

Thank you so very much. mikebur

--
mikebur
-----------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...fo&userid=2458
View this thread: http://www.excelforum.com/showthread.php?threadid=49060

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
Can I suppress the text in Excel an just print the cells I want t Luis Dominguez Excel Discussion (Misc queries) 0 November 9th 05 08:10 PM
BeforeDoubleClick Cancel=True not working Reggie Excel Programming 1 September 20th 05 03:43 AM
Before print, cancel print and cancel copy/paste Claus[_3_] Excel Programming 5 August 26th 05 11:13 AM
Setting Cancel = True in WorkbookBeforePrint Tony Excel Programming 0 December 21st 03 10:37 PM
cancel a print libby Excel Programming 1 November 21st 03 11:21 PM


All times are GMT +1. The time now is 01:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"