Print a Spreadsheet w/Task Scheduler

L

Leslie

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
 
D

Dave Peterson

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.
 
L

Leslie

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top