Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Printing at certain times of a day

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Printing at certain times of a day

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
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 Single Worksheet Multiple Times with Different Data Jr. New Users to Excel 6 October 16th 07 05:53 PM
Printing mulitple times to adobe TimT Excel Discussion (Misc queries) 0 July 20th 07 02:52 PM
Calculation of hourly rate times hours times 1.5 Newbusinessbod Excel Worksheet Functions 1 December 6th 05 04:44 PM
Charting and analyzing Times' times data for trends Johnny Excel Discussion (Misc queries) 1 May 5th 05 01:36 AM
Printing during select times Rockee052[_28_] Excel Programming 1 February 6th 04 08:35 PM


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