Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default 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
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
task scheduler Big Jim New Users to Excel 0 June 1st 06 07:00 PM
Task Scheduler timothyp[_3_] Excel Programming 0 September 22nd 04 08:47 PM
Task Scheduler Jarek[_15_] Excel Programming 0 September 22nd 04 01:54 PM
Task Scheduler Randy[_15_] Excel Programming 1 September 8th 04 07:37 PM
Task Scheduler Rone Excel Programming 1 December 12th 03 06:10 PM


All times are GMT +1. The time now is 08:52 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"