Print excel file from DOS command line

D

despistado

How can I print an Excel file from DOS command line? I am working wit
Excel 2000
 
D

Dave Peterson

You could create a small .vbs (scripting file) and run that.

The script opens excel, opens your file, prints the workbook, closes your file
and closes excel.

Copy this into notepad and save that file as: something.vbs

Dim XL
Dim XLWkbk

Set XL = CreateObject("excel.application")
XL.Visible = True

Set XLWkbk = XL.Workbooks.Open("C:\my documents\excel\book11.xls")

XLWkbk.PrintOut

XLWkbk.Close False
XL.Quit

Set XLWkbk = Nothing
Set XL = Nothing


===
Adjust the name/location of the file to print.
 

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