Scheduled print of a excel doc that is always open

B

Ben Wright

Hi All,


I am fairly new to excel and have managed to end up having to creat
something i feel way over my head !!


I am trying to get a excel spreadsheet that is open 24/7 on a desktop t
print out every morning at 05:00

But i do not know how to do this.

The document is open 24/7 and is being constantly updated by
production machine giving us live data (ddeserver)


We want this to print at 05:00 hours as as 05:00 the counters get rese
and start back at 0 (so when we start work at eight the figures mea
nothing to us)


The workbook contain 4 tabs on the bottom and only 2 need printing.



Can somebody help me in how to do this please?



Regards

Ben Wrigh
 
C

Charlotte E.

This little macro should du the trick:

Sub Print_At_Five()

ActiveSheet.PrintOut
Application.OnTime TimeValue("05:00:00"), "Print_At_Five"

End Sub


First time the macro is run, it will print the current active sheet, and
then do it over again everytime the clock reaches 05:00, as long as the
spreadsheet is not closed.


CE



Den 18.05.2012 14:41, Ben Wright skrev:
 
V

Vacuum Sealed

Hmm,

If the counters get reset at 5.00am would it not be prudent to do the
print outs a minute earlier to avoid running head on into that process.

Charlotte, I feel this would require activation of the OnTime Event.

I use the following to Enable/Disable an AutoSave feature...

Option Explicit
Public RunTime

Sub StartTimer()

RunTime = TimeValue("04:59:00")
Application.OnTime RunTime, "Print_At_Five", schedule:=True

End Sub

Sub Print_At_Five()

Dim my1stSht as worksheet, my2ndSht as worksheet

Set my1stSht = Sheets("Your 1st Sheet")
Set my2ndSht = Sheets("Your 2nd Sheet")

my1stSht.PrintOut
my2ndSht.PrintOut


End Sub

Create a Macro button on your main sheet somewhere out of the way and
"Assign Macro" ( StartTimer ) to the button and click to activate.

HTH
Mick.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top