PC Review


Reply
Thread Tools Rate Thread

Print an excel file from command line or "cron" type command ???

 
 
Chris Salcedo
Guest
Posts: n/a
 
      27th Mar 2007
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 With Quote
 
 
 
 
Deborah Digby
Guest
Posts: n/a
 
      27th Mar 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 With Quote
 
 
 
 
=?Utf-8?B?SkxHV2hpeg==?=
Guest
Posts: n/a
 
      28th Mar 2007
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Command line option syntax error. Type Command /? for Help §ñühw€£f DIY PC 2 19th Apr 2009 10:23 PM
Command line option syntax.error.type command for hlp/? =?Utf-8?B?amVyZW15?= Microsoft Outlook Discussion 6 29th Oct 2006 08:16 PM
Command Line Option Syntax Error - Type Command /? for Help Bob Breslin Microsoft Outlook Interoperability 2 14th Dec 2004 07:01 AM
Command line error D2016 : '/RTC1' and '/clr:initialappdomain' command-line options are incompatible Lars Grøtteland Microsoft Dot NET Framework 1 15th Oct 2003 09:35 AM
Command line error D2016 : '/RTC1' and '/clr:initialappdomain' command-line options are incompatible Lars Grøtteland Microsoft Dot NET 1 15th Oct 2003 09:35 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:21 AM.