Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Print a Spreadsheet w/Task Scheduler
I want to print a spreadsheet as a scheduled task.
Is there a DOS command to do this or can this be done with a Macro. I can launch the spreadsheet with \Path\EXCEL.EXE <FileName and I could write a Macro possibly to actually execute the print. Just brainstorming for ideas. Any ideas from the experts? Leslie |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Print a Spreadsheet w/Task Scheduler
How about scheduling a script?
Save this text file as somename.VBS Dim XLApp Dim XLWkb Set XLApp = CreateObject("Excel.Application") xlapp.visible = true xlapp.workbooks.open "c:\my documents\excel\book3.xls" xlapp.activeworkbook.worksheets("sheet1").printout xlapp.activeworkbook.close xlapp.quit Change the path and filename to what you need. If you have macros, you'll want to set security to low--you don't want to be prompted. Leslie wrote: I want to print a spreadsheet as a scheduled task. Is there a DOS command to do this or can this be done with a Macro. I can launch the spreadsheet with \Path\EXCEL.EXE <FileName and I could write a Macro possibly to actually execute the print. Just brainstorming for ideas. Any ideas from the experts? Leslie -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Print a Spreadsheet w/Task Scheduler
Dave,
This is exactly what I'm looking for! Using the VB script is a perfect solution. I've since found MSFT used to have a /p command you used to be able to put after the \path\Excel.exe <filename /p to print the files. They removed this functionality a couple windows versions back and it simply baffles me why they would remove such a fundamental functionality and force a person to have to write scripts (which is OK, but a single command line capability would be much easier). In any case, Dave, THANK YOU! Leslie "Dave Peterson" wrote: How about scheduling a script? Save this text file as somename.VBS Dim XLApp Dim XLWkb Set XLApp = CreateObject("Excel.Application") xlapp.visible = true xlapp.workbooks.open "c:\my documents\excel\book3.xls" xlapp.activeworkbook.worksheets("sheet1").printout xlapp.activeworkbook.close xlapp.quit Change the path and filename to what you need. If you have macros, you'll want to set security to low--you don't want to be prompted. Leslie wrote: I want to print a spreadsheet as a scheduled task. Is there a DOS command to do this or can this be done with a Macro. I can launch the spreadsheet with \Path\EXCEL.EXE <FileName and I could write a Macro possibly to actually execute the print. Just brainstorming for ideas. Any ideas from the experts? Leslie -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
task scheduler | New Users to Excel | |||
Task Scheduler | Excel Programming | |||
Task Scheduler | Excel Programming | |||
Task Scheduler | Excel Programming | |||
Task Scheduler | Excel Programming |