I don't think you can do it directly from a command line. You could use a
somewhat indirect approach with a vbScript. If you save what I've got
between the lines below as a text file with a VBS extension (for example,
C:\Test\PrintWkbk.vbs) then you can either drag xls files into the vbs or a
shortcut to it or you can use a command line like:
C:\Test\PrintWkbk.vbs "C:\xlFiles\Text.xls"
to print the Workbook. Note that if you have disabled file associations for
scripts, you may have to use the command line
WScript.exe C:\Test\PrintWkbk.vbs "C:\xlFiles\Text.xls"
_____________________________________________________________
Const xlDoNotSaveChanges = 2
Dim fso, oXL, oWkbk
Set fso = CreateObject("Scripting.FileSystemObject")
Set oXL = CreateObject("Excel.Application")
oXL.Visible = False
If WScript.Arguments.Count = 0 Then
WScript.Quit
Else
For A = 0 To (WScript.Arguments.Count - 1)
If (Right(WScript.Arguments.Item(A), 3) = "xls") _
AND fso.FileExists(WScript.Arguments.Item(A)) Then
Set oWkbk = oXL.Workbooks.Open(WScript.Arguments.Item(A))
oWkbk.PrintOut
oWkbk.Close xlDoNotSaveChanges
End If
Next
End If
oXL.Quit
Set fso = Nothing
Set oXL = Nothing
_____________________________________________________________
Steve Yandl