Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Print an excel file from command line or "cron" type command ???

I need to print an excel file at 3:15 every day. I would like to be
able to "schedule" it like in a cron job...(windows of course...) I
cant find any way to directly print from a comman line like "excel.exe
"c:\myfile.xls" /p

Any Ideas ????

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Print an excel file from command line or "cron" type command ???

If you can make sure that the Excel spreadsheet in questions is opened a
little before 3:15, then you can can put use Application.OnTime. eg

Private Sub Workbook_open()
application.onTime Date + TimeSerial(15,15,0), "PrintRoutine"
end sub

in a module:

Sub PrintRoutine()
dim sh as Object
for each sh in thisworkbook.Sheets
ws.printout
next sh
End Sub

Once the workbook is opened, it will do nothing until 3.15pm when it will
run PrintRoutine. It is worth saying that if you open this after 3.15pm it
will cause an error as the specified time is in the past.

"Chris Salcedo" wrote in message
oups.com...
I need to print an excel file at 3:15 every day. I would like to be
able to "schedule" it like in a cron job...(windows of course...) I
cant find any way to directly print from a comman line like "excel.exe
"c:\myfile.xls" /p

Any Ideas ????



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Print an excel file from command line or "cron" type command ???

This if from the VBA Help file using the OnTime method:

Application.OnTime TimeValue("17:00:00"), "my_Procedure"

It starts the macro at 5 P.M. Maybe you could use this.

"Chris Salcedo" wrote:

I need to print an excel file at 3:15 every day. I would like to be
able to "schedule" it like in a cron job...(windows of course...) I
cant find any way to directly print from a comman line like "excel.exe
"c:\myfile.xls" /p

Any Ideas ????


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
["\r\n" new line command in CSV file] Cathy Excel Discussion (Misc queries) 1 August 17th 09 05:43 PM
Need command line to change "#DIV/0!" into a "0" (zero) mulehead Excel Discussion (Misc queries) 1 May 20th 08 02:09 PM
How to "Replace()" multiple characters in one VBA command line EagleOne Excel Discussion (Misc queries) 1 April 11th 07 04:12 PM
Removing "Save As" Command from an excel file. Camper Joe Excel Worksheet Functions 0 December 19th 05 03:00 PM
Excel VBA File Search Command Cannot "See" VBA Project Name gfhunt Excel Programming 0 May 23rd 04 04:36 AM


All times are GMT +1. The time now is 08:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"