Print Out Method

The PrintOut method prints an entire workbook. (This method applies to a host of other objects as well, such as Range, Worksheet, and Chart.) The syntax is:

WorkbookObject.PrintOut(From, To, Copies,

Preview, ActivePrinter, PrintToFile, Collate)

Note that all of the parameters to this method are optional.

The From parameter specifies the page number of the first page to print, and the To parameter specifies the last page to print. If omitted, the entire object (range, worksheet, etc.) is printed.

The Copies parameter specifies the number of copies to print. The default is 1.

Set Preview to True to invoke print preview rather than printing immediately. The default is


ActivePrinter sets the name of the active printer. On the other hand, setting PrintToFile to True causes Excel to print to a file. Excel will prompt the user for the name of the output file. (Unfortunately, there is no way to specify the name of the output file in code.)

The Collate parameter should be set to True to collate multiple multipage copies.

0 0


  • laura took-took
    What is the file type of the printout method in vba?
    8 years ago

Post a comment