![]() |
Scheduled print of a excel doc that is always open
Hi All,
I am fairly new to excel and have managed to end up having to create something i feel way over my head !! I am trying to get a excel spreadsheet that is open 24/7 on a desktop to 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 a production machine giving us live data (ddeserver) We want this to print at 05:00 hours as as 05:00 the counters get reset and start back at 0 (so when we start work at eight the figures mean 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 Wright |
Scheduled print of a excel doc that is always open
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: Hi All, I am fairly new to excel and have managed to end up having to create something i feel way over my head !! I am trying to get a excel spreadsheet that is open 24/7 on a desktop to 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 a production machine giving us live data (ddeserver) We want this to print at 05:00 hours as as 05:00 the counters get reset and start back at 0 (so when we start work at eight the figures mean 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 Wright |
Scheduled print of a excel doc that is always open
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. |
All times are GMT +1. The time now is 10:04 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com