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

Sorry about the previous post! I guess my mouse got a mind
of it's own. I am doing the following in a loop
Open Workbook
Activate proper worksheet
Set Print Area
Print worksheet
Close Workbook
This will be done on approx 150 to 200 workbooks. My
question: does the PrintOut method 1)simply queue the print
job, in which case I'm wondering: could I run out of memory
during the process and if so, are there workarounds or
2)does it wait for the print job to complete (I don't see
any flag parameter such as Wait/No Wait to request that it
wait to continue coding). I would assume it does the former
but am not sure about whether this could be troublesome. I
don't easily have access to the data it'll be used with so
it's hard to do a test run. I am not sure how much memory a
print queue can allocate or if it caches disk space, etc.
All the innards of printing are foreign to me. Thanks in
advance! Sincerely, Phil
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Batch printing

If you are on a network, the print queue is managed by the print server.
The print job is cached on a disk somewhere and sent to the printer as it
becomes available. Doing a printout initiates this caching. I believe the
code waits until the job is "printed" meaning cached - stored as a file, and
then moves on. Since it is on a disk, you should not have a problem with
printing away.

--
Regards,
Tom Ogilvy

"Phil Berkhof" wrote in message
...
Sorry about the previous post! I guess my mouse got a mind
of it's own. I am doing the following in a loop
Open Workbook
Activate proper worksheet
Set Print Area
Print worksheet
Close Workbook
This will be done on approx 150 to 200 workbooks. My
question: does the PrintOut method 1)simply queue the print
job, in which case I'm wondering: could I run out of memory
during the process and if so, are there workarounds or
2)does it wait for the print job to complete (I don't see
any flag parameter such as Wait/No Wait to request that it
wait to continue coding). I would assume it does the former
but am not sure about whether this could be troublesome. I
don't easily have access to the data it'll be used with so
it's hard to do a test run. I am not sure how much memory a
print queue can allocate or if it caches disk space, etc.
All the innards of printing are foreign to me. Thanks in
advance! Sincerely, Phil



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Batch printing

Phil,

I have a master workbook that opens and prints from many workbooks.
This job would overload our printer so I inserted this into the code.
The pause time is arbitrary.

' Pause macro to prevent print que from overload
Dim PauseTime, Start, Finish, TotalTime
PauseTime = 5 ' Set duration.
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
DoEvents ' Yield to other processes.
Loop
Finish = Timer ' Set end time.
TotalTime = Finish - Start ' Calculate total time.

--
sb
"Phil Berkhof" wrote in message
...
Sorry about the previous post! I guess my mouse got a mind
of it's own. I am doing the following in a loop
Open Workbook
Activate proper worksheet
Set Print Area
Print worksheet
Close Workbook
This will be done on approx 150 to 200 workbooks. My
question: does the PrintOut method 1)simply queue the print
job, in which case I'm wondering: could I run out of memory
during the process and if so, are there workarounds or
2)does it wait for the print job to complete (I don't see
any flag parameter such as Wait/No Wait to request that it
wait to continue coding). I would assume it does the former
but am not sure about whether this could be troublesome. I
don't easily have access to the data it'll be used with so
it's hard to do a test run. I am not sure how much memory a
print queue can allocate or if it caches disk space, etc.
All the innards of printing are foreign to me. Thanks in
advance! Sincerely, Phil



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Batch printing

Thanks Tom! Thanks Steve! I've asked my testers to test
100 on a local connection and if we run into problems I
will use your pause code Steve. I also wasn't sure how to
pause without being preemptive. DoEvents sounds great!
Steve, do you have any thoughts about where to put your
code? Phil
-----Original Message-----
Sorry about the previous post! I guess my mouse got a mind
of it's own. I am doing the following in a loop
Open Workbook
Activate proper worksheet
Set Print Area
Print worksheet
Close Workbook
This will be done on approx 150 to 200 workbooks. My
question: does the PrintOut method 1)simply queue the print
job, in which case I'm wondering: could I run out of memory
during the process and if so, are there workarounds or
2)does it wait for the print job to complete (I don't see
any flag parameter such as Wait/No Wait to request that it
wait to continue coding). I would assume it does the former
but am not sure about whether this could be troublesome. I
don't easily have access to the data it'll be used with so
it's hard to do a test run. I am not sure how much memory a
print queue can allocate or if it caches disk space, etc.
All the innards of printing are foreign to me. Thanks in
advance! Sincerely, Phil
.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Batch printing

Phil,

You can do it one of two way (maybe more).
Assuming that you are using some kind of loop:
1. Change the pause time to something very small (1 second or less) and
put it after each print in your code.
2. Set up some kind of counter and put it after the print in your code.
Have the counter activate if it is equal to a multiple of 5, or 10, or
.....

My workbooks have many sheets to print. Here's my code. It first opens
a workbook and than prints each sheet. Closes the workbook. Than
pauses. Than goes on to the next.

Sub PrintAllDivisions()
'upgraded 6/2/99

Static ccc, chrt, rank As String, wws As Single
Application.ScreenUpdating = False
Application.EnableEvents = False
nkpi = Sheets("sheet1").Cells(2, 9)
nws = ActiveWorkbook.Worksheets.Count

Application.Dialogs(xlDialogPrinterSetup).Show

' Select division to Print
For x = 1 To WorksheetFunction.Max(Sheets("sheet1").Columns(7))
divname = WorksheetFunction.Index(Sheets("sheet1").Columns(5 ),
WorksheetFunction.Match(x, Sheets("sheet1").Columns(7), 0), 1)

Workbooks.Open FileName:="\\Buenapark02\kpi\Distribution_KPI\" & divname
& "\" & divname
For z = 3 To ActiveWorkbook.Worksheets.Count

Sheets(z).Select

Application.StatusBar = divname & " in Print Que"

ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("A1").Select
linenext:
Next
ActiveWorkbook.Close False

' Pause macro to prevent print que from overload - added 3/7/02
Dim PauseTime, Start, Finish, TotalTime
PauseTime = 5 ' Set duration.
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
DoEvents ' Yield to other processes.
Loop
Finish = Timer ' Set end time.
TotalTime = Finish - Start ' Calculate total time.

line1:
Next

line2:
Worksheets("buttons").Activate
Cells(3, 7).Activate

Application.StatusBar = ""

Worksheets("rankings").Visible = True
Worksheets("consolidated").Visible = True
Application.ScreenUpdating = True
Application.EnableEvents = True

End Sub

--
sb
"Phil Berkhof" wrote in message
...
Thanks Tom! Thanks Steve! I've asked my testers to test
100 on a local connection and if we run into problems I
will use your pause code Steve. I also wasn't sure how to
pause without being preemptive. DoEvents sounds great!
Steve, do you have any thoughts about where to put your
code? Phil
-----Original Message-----
Sorry about the previous post! I guess my mouse got a mind
of it's own. I am doing the following in a loop
Open Workbook
Activate proper worksheet
Set Print Area
Print worksheet
Close Workbook
This will be done on approx 150 to 200 workbooks. My
question: does the PrintOut method 1)simply queue the print
job, in which case I'm wondering: could I run out of memory
during the process and if so, are there workarounds or
2)does it wait for the print job to complete (I don't see
any flag parameter such as Wait/No Wait to request that it
wait to continue coding). I would assume it does the former
but am not sure about whether this could be troublesome. I
don't easily have access to the data it'll be used with so
it's hard to do a test run. I am not sure how much memory a
print queue can allocate or if it caches disk space, etc.
All the innards of printing are foreign to me. Thanks in
advance! Sincerely, Phil
.



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
run batch job from each row - how to insert run batch function per row? Mitchell_Collen via OfficeKB.com Excel Discussion (Misc queries) 5 February 26th 09 07:16 AM
Batch Printing - filtered by Picklist naz Excel Worksheet Functions 1 June 27th 07 07:24 PM
batch printing without VBA krikri Excel Discussion (Misc queries) 2 February 9th 06 02:24 PM
How batch calculations? ZPXY Excel Worksheet Functions 2 September 21st 05 07:17 AM
Batch printing Phil Berkhof Excel Programming 1 October 21st 03 01:35 PM


All times are GMT +1. The time now is 10:47 PM.

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"