Thanks to Alberto Voli for this little tip. The code below can be used to print an Excel file without having to manipulate the printer dialogs. It uses VBScript to interface with Excels’ COM object model to call it’s PrintOut method.
Place the VBSTART .. VBEND lines near the top of your script ready for use. To use modify the path to the Excel file in the VBRun line and place that line where needed.
You can use this approach with other Microsoft Office Apps, e.g. Word. A good tip is to record a macro within Excel or Word using it’s own macro recorder. This will create VBA code. You can then view the VBA code to figure out what objects and methods you need. You can then convert it to VBScript which you can run inside Macro Scheduler.