Help - Juan Pablo to the rescue


Posted by Kevin Mac on December 27, 2001 12:20 PM

In the code below, which was provided by Ivan, what exactly am I looking to change? In just glancing over it, I assume I will have to edit where he has "Call your print procedure here", but I am not sure what I need to enter, also I assume that I will have to change "My print job1", but again I am not sure what I am supposed to enter, other than possibly my workbook name, and lastly, I assume I need to modify the following: Sub MyPrint_Procedure()
'This is run to print to
'your network printers
End Sub
But, I am not sure if I just enter my print server / printer pathing or if something more is required here. Any input is appreciated.

Here is an example....change as required OR
repost;

This is the initial procedure to run

Sub RunMyPrint_Procedures()
'Run 1st Job
Application.OnTime TimeValue("16:55:00"), "MyPrintJob1"
End Sub

Sub MyPrintJob1()
MsgBox "running my print job1"
'-------------------------------
'Call your print procedure here
'
'
'
'-------------------------------
'Now call routine to cancell Ontime
CancelOT 1
'Now Call 2nd print job
Application.OnTime TimeValue("16:56:00"), "MyPrintJob2"
End Sub

Sub MyPrintJob2()
MsgBox "running my print job2"
'-------------------------------
'Call your print procedure here
'
'
'
'-------------------------------
'Now call routine to cancell Ontime
CancelOT 2
'Call 2nd print job
Application.OnTime TimeValue("16:57:00"), "MyPrintJob3"
End Sub

Sub MyPrintJob3()
MsgBox "running my print job3"
'-------------------------------
'Call your print procedure here
'
'
'
'-------------------------------
'Now call routine to cancell Ontime
CancelOT 3
End Sub

Sub MyPrint_Procedure()
'This is run to print to
'your network printers
End Sub

Sub CancelOT(Whichone As Single)

Select Case Whichone
Case 1
'Cancell 1st Job
Application.OnTime TimeValue("16:55:00"), "MyPrintJob1", False

Case 2
'Cancell 2nd Job
Application.OnTime TimeValue("16:56:00"), "MyPrintJob2", False

Case 3
'Cancell 3rd job
Application.OnTime TimeValue("16:57:00"), "MyPrintJob3", False

End Select

End Sub


HTH

Ivan

Posted by Juan Pablo G. on December 27, 2001 12:26 PM

For what i see, Ivan is assuming three prints, one at 4:55 p.m, another one at 4:56 and another one at 4:56.

You need to change this:

'-------------------------------
'Call your print procedure here
'
'
'
'-------------------------------

There you can change what you want to print, how many copies, etc.

Juan Pablo G.

This is what I am unsure of, is this where I input my print server name/printer name, number of copies needed when sent to the print queue, etc...If so, can you give me a headstart on what to input as I am not sure how to modify this code -------------------------------

Posted by Kevin Mac on December 27, 2001 12:50 PM

Re: Help - Juan Pablo is a True Genius at work.



Posted by Juan Pablo G. on December 27, 2001 1:03 PM

Re: Help - Juan Pablo is a True Genius at work.

> This is what I am unsure of, is this where I input my print server name/printer name, number of copies needed when sent to the print queue, etc...

Yes

> If so, can you give me a headstart on what to input as I am not sure how to modify this code

For example,

ActiveSheet.PrintOut

will print the active sheet, all pages, current settings, one copy.

You can use following to setup print

With ActiveSheet.PageSetup
.CenterFooter "Whatever"
.LeftHeader = "Text here"
End With

Check out the help for other properties and methods.

Juan Pablo G.