Select the File tab and click the Print Preview button in the Common group. This invokes the Print Preview form which allows you to preview your workbook.
At the bottom of the Preview window, you can see the number of pages and the current page's number. Note that blank worksheets are not displayed or printed. You can also print the current workbook via the Preview window by clicking the Print... button in the Print group.
// Print a workbook loaded into the SpreadsheetControl.
If spreadsheetControl.IsPrintingAvailable Then
' Print a workbook loaded into the SpreadsheetControl.
To print a specific sheet in a workbook, use the Sheet.Print method.
Set a Print Area
Via the Ribbon UI
You can define a print area to print a specific part of the worksheet. Select the cells you wish to print, and then on the Page Layout tab, in the Page Setup group, click the Print Area button. In the button's drop-down list, click Set Print Area.
When you specify the print area, the cell range that it comprises gets a thin dashed outline and the _xlnm.Print_Area name is added to the defined names contained in the workbook.
Extend the existing print area by selecting the cell range you wish to add to the print area, and clicking Print Area | Add to Print Area in the Page Setup group. Note that if the print area consists of non-adjacent cell ranges, they are each printed on a separate page.
To print the entire worksheet, remove the print area by clicking Print Area | Clear Print Area.
You can print row or column headings on every page to help improve readability. To do this, on the Page Layout tab, in the Page Setup group, click Print Titles to invoke the Page Setup dialog.
In the Rows to repeat at top and Columns to repeat at left boxes, enter references to the title rows and/or columns you wish to repeat or select them directly in the worksheet by clicking the Collapse Dialog button .
The Export to PDF document describes PDF export features and limitations.
Specify Print Options
Via the Ribbon UI
Before printing a workbook, an end-user can specify print settings for individual worksheets using the SpreadsheetControl's Page Setup ribbon page group. Use this group's buttons to specify page margins, document orientation, and paper size. Invoke the Page Setup dialog by clicking the Page Setup dialog box launcher to set more specific printout settings (such as print scaling, page order, header and footer options, etc.).
Use properties of the WorksheetView object to specify print options. WorksheetView enables you to specify general page options such as orientation, margins, and paper size settings. Use the WorksheetPrintOptions object's properties to define more print-specific options. Refer to the Printing section for examples.
You can prevent worksheets from printing by handling the SpreadsheetControl.BeforePrintSheet event, which occurs before a workbook is printed. Use the Index or Name properties of the event parameter to get a worksheet to be printed, and set the Cancel property to true to cancel printing.
The example below demonstrates how to print the active worksheet only.
bool printActiveSheetOnly = true;
private void spreadsheetControl_BeforePrintSheet(object sender, BeforePrintSheetEventArgs e)
// Cancel printing if the index of the worksheet to be printed is not equal to the active sheet index.
e.Cancel = spreadsheetControl.ActiveWorksheet.Index != e.Index;
Private printActiveSheetOnly As Boolean = True
Private Sub spreadsheetControl_BeforePrintSheet(ByVal sender As Object, ByVal e As BeforePrintSheetEventArgs)
If printActiveSheetOnly Then
' Cancel printing if the index of the worksheet to be printed is not equal to the active sheet index.
e.Cancel = spreadsheetControl.ActiveWorksheet.Index <> e.Index