Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Printing Macro

I have this code located under ThisWorkbook to intercept a print request,
and run my code to print multiple copies. Now I know most of you will say
"why not just set the #of copies" well the problem is when I do that our
Color Laser will print lines in the merged cells where the boarder would be
if the cells were not merged, but if I print one at a time it does not do it
(very strange behavior, but IT will not replace my print just for that). I
am at a loss here. So how can I loop through the multiple print routines
without triggering the BeforePrint code?





Private Sub Workbook_BeforePrint(Cancel As Boolean)

On Error GoTo EndPoint

Printing.Show

'EndPoint:
Cancel = True

EndPoint:


End Sub

---------------------------------------------------------

This code is in it's own module (not located under ThisWorkbook )


Private Sub CommandButton1_Click()

SortRoutesToCover.SortRoutesToCover

If OptionButton1.Value = True Then

ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Paratransit_Color_Laser on Ne01:", Collate:=True

Unload Printing

ElseIf OptionButton2.Value = True Then

ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Paratransit_Color_Laser on Ne01:", Collate:=True

ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Paratransit_Color_Laser on Ne01:", Collate:=True

Unload Printing

End If

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Printing Macro

Just figured it out after hours of frustration. Adding
Application.EnableEvents on both ends of the code was all it took.

Application.EnableEvents = False

ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Paratransit_Color_Laser on Ne01:", Collate:=True

Application.EnableEvents = True



"Patrick C. Simonds" wrote in message
...
I have this code located under ThisWorkbook to intercept a print request,
and run my code to print multiple copies. Now I know most of you will say
"why not just set the #of copies" well the problem is when I do that our
Color Laser will print lines in the merged cells where the boarder would be
if the cells were not merged, but if I print one at a time it does not do
it (very strange behavior, but IT will not replace my print just for that).
I am at a loss here. So how can I loop through the multiple print routines
without triggering the BeforePrint code?





Private Sub Workbook_BeforePrint(Cancel As Boolean)

On Error GoTo EndPoint

Printing.Show

'EndPoint:
Cancel = True

EndPoint:


End Sub

---------------------------------------------------------

This code is in it's own module (not located under ThisWorkbook )


Private Sub CommandButton1_Click()

SortRoutesToCover.SortRoutesToCover

If OptionButton1.Value = True Then

ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Paratransit_Color_Laser on Ne01:", Collate:=True

Unload Printing

ElseIf OptionButton2.Value = True Then

ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Paratransit_Color_Laser on Ne01:", Collate:=True

ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Paratransit_Color_Laser on Ne01:", Collate:=True

Unload Printing

End If

End Sub


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
Printing Macro Ram Excel Discussion (Misc queries) 0 December 7th 06 01:01 AM
Macro for printing Ewout Excel Worksheet Functions 1 September 23rd 06 11:33 PM
printing macro johnw Excel Discussion (Misc queries) 0 October 7th 05 02:31 PM
Need help for Printing Macro. sighsky Excel Programming 1 June 13th 05 03:06 PM
Printing Macro kwedde01 Excel Discussion (Misc queries) 1 June 10th 05 04:36 AM


All times are GMT +1. The time now is 02:37 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"