Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm looking to see if I can print a sheet in excel 2003 at certain times
during a 24 hour period. I have collected Data and would like it to print the sheet without someone having to be there. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The OnTime event can be used to schedule a procedure to run. The worksheet
would have to be running (at least in the background) continually, but here's what you could do. You would need to run a procedure to "trigger" the whole thing - this could be a macro you run manually or if desired could be the Workbook_Open event procedure. It just needs to set up the time for printing and call the Application.OnTime method. With Application.OnTime you specify "by name" the procedure you want to run and when it should happen; the whole thing could look something like this (I will set it up to print every 6 hours starting 6 am): Sub Workbook_Open() Dim TimePeriod as Integer, TimeToPrint as Date TimePeriod = Int(Hour(Now())/6)+1 TimeToPrint = TimeValue(Choose(TimePeriod,"06:00:00","12:00:00", "18:00:00","23:59:59")) Application.OnTime TimeToPrint, "TimedPrint" End Sub Sub TimedPrint() ThisWorkbook.Printout Application.Wait (Now()+10) ' Just to make sure we are into the next time period Call Workbook_Open() End Sub If you need to you can cancel the OnTime procedure that is next scheduled to run by Application.OnTime TimeToPrint, "TimedPrint", , False -- - K Dales "NelsonPG" wrote: I'm looking to see if I can print a sheet in excel 2003 at certain times during a 24 hour period. I have collected Data and would like it to print the sheet without someone having to be there. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Printing Single Worksheet Multiple Times with Different Data | New Users to Excel | |||
Printing mulitple times to adobe | Excel Discussion (Misc queries) | |||
Calculation of hourly rate times hours times 1.5 | Excel Worksheet Functions | |||
Charting and analyzing Times' times data for trends | Excel Discussion (Misc queries) | |||
Printing during select times | Excel Programming |