ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   command line script for printing MS Excel 2000 document. (https://www.excelbanter.com/excel-programming/276403-command-line-script-printing-ms-excel-2000-document.html)

Mitso

command line script for printing MS Excel 2000 document.
 
I am looking for a way to schedule an Excel Document to automatically
print using the scheduled Tasks of Windows XP. I can't for the life
of me figure out if a command line switch exists for doing such a
thing, and was wondering if anyone has been able to do this.

Thanks for your thoughts.

Michael Stavropoulos


tomhaddock[_7_]

command line script for printing MS Excel 2000 document.
 
Hi

There is one way - go to ThisWorkBook in VBE and paste the following
code

Private Sub Workbook_Open()

Range("$A$1:$M$30").PrintOut Copies:=1, Collate:=True
Application.DisplayAlerts = False
Application.Quit

End Sub

Change the range to suit your print area and then schedule a task to
open that Excel file. So when it opens it will print it then close it
(without saving).

This is untested code as I do not have printer at the moment. If you
want open the workbook without printing the code hold down Shift before
opening.

Tom


All times are GMT +1. The time now is 11:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com