scheduler printing off excel document

benjamintheblue

New Member
Joined
Jan 9, 2003
Messages
5
I am trying to use my pc windows task scheduler to automatically print off a document called square numbers. I am using the command below and this brings the document up at the right time.

run "C:\WINNT\Profiles\benjamin\Desktop\ben\SQUARE NUMBERS.xls"
start in "D:\Program Files\Microsoft Office\Office"

I guess this would work through dos also, but I cant seem insert /p anywhere that will make it work.
I have tried run /p "C:\WINNT\Profiles\langton_ae\Desktop\andy\SQUARE NUMBERS.xls"
anyone help in this type of stuff?
or possibly some visual basic that when the document is opened it will print. Then this might work. Thanks Ben
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
I can't help with the scheduler part, this will print all the worksheets when the wb is opened:

<font face=Tahoma><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> Workbook_Open()
    <SPAN style="color:#00007F">Dim</SPAN> ws <SPAN style="color:#00007F">As</SPAN> Worksheet
        <SPAN style="color:#00007F">For</SPAN> <SPAN style="color:#00007F">Each</SPAN> ws <SPAN style="color:#00007F">In</SPAN> ActiveWorkbook.Worksheets
            <SPAN style="color:#00007F">If</SPAN> Application.CountA(ws.Cells) <> 0 <SPAN style="color:#00007F">Then</SPAN> ws.PrintOut
        <SPAN style="color:#00007F">Next</SPAN> ws
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>

The code goes in the ThisWorkbook module.

HTH,

Smitty
 
Upvote 0

Forum statistics

Threads
1,224,856
Messages
6,181,424
Members
453,039
Latest member
jr25673

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top