Represents a custom view in Microsoft Excel.

Custom views provide a way to save display options and optionally print options for the workbook and each worksheet in the workbook. These options can be different from the options currently set on the workbook and worksheets.

Multiple custom views can be saved with a workbook, and the options from a custom view can be applied to its associated workbook by calling the apply method on it.

See

Workbook.customViews

Hierarchy

Hierarchy

Constructors

Properties

$type: Type
$t: Type
nextHashCode: number

Accessors

  • get name(): string
  • Gets or sets the name of the custom view.

    The name of the custom view is displayed in the custom views dialog of Microsoft Excel and must be case-insensitively unique to other custom views in the workbook.

    The name of the custom view.

    Throws

    ArgumentNullException The value assigned is a null or empty.

    Throws

    ArgumentException The value assigned is the name of another custom view in this custom view's associated workbook (custom view names are compared case-insensitively).

    Returns string

  • set name(a: string): void
  • Parameters

    • a: string

    Returns void

  • get saveHiddenRowsAndColumns(): boolean
  • Gets the value indicating whether hidden row and column settings are saved with the custom view.

    If the value is False, the return value of getHiddenColumns and getHiddenRows will always be null, regardless of the worksheet specified.

    The value indicating whether hidden row and column settings are saved with the custom view.

    See

    Returns boolean

  • get savePrintOptions(): boolean
  • Gets the value indicating whether print options are saved with the custom view.

    If the value is False, the return value of getPrintOptions will always be null, regardless of the worksheet specified.

    The value indicating whether print options are saved with the custom view.

    See

    Returns boolean

  • get windowOptions(): CustomViewWindowOptions
  • Gets the window options for the workbook associated with the custom view.

    Setting properties on the returned windowOptions instance will not change the actual window options of the associated workbook. After setting properties, the apply method of the CustomView will apply them to the workbook.

    The window options for the workbook associated with the custom view..

    See

    Returns CustomViewWindowOptions

Methods

  • Applies all options from the custom view to the associated workbook and its worksheets.

    There is no state of the workbook indicating the custom view currently applied, so applying a custom view simply copies over all options saved with it to the workbook and its worksheet. If an applied custom view is then changed, those changes will not be updated on the workbook or worksheets. Instead, the custom view will need to be applied again for those changes to be reflected on the workbook or worksheet.

    Throws

    InvalidOperationException The custom view has previously been removed from its associated workbook.

    Returns void

  • Parameters

    • other: any

    Returns boolean

  • Gets the display options associated with the specified worksheet.

    Setting properties on the returned DisplayOptions instance will not change the actual display of the worksheet. After setting properties, the apply method of the CustomView will apply them to the worksheet.

    Throws

    ArgumentNullException 'worksheet' is null.

    Returns

    Null if the worksheet does not belong to the workbook associated with this custom view; otherwise, the display options associated with the worksheet.

    See

    Worksheet.displayOptions

    Parameters

    • worksheet: Worksheet

      The worksheet whose associated display options are to be retrieved.

    • Optional createIfNull: boolean

      True to create the display options if it has not yet been allocated. The options will be initialized based on the current state of the Worksheet. Note the options should only have been null if there were no options for the Worksheet when the Workbook was loaded.

    Returns CustomViewDisplayOptions

  • Returns number

  • Gets the hidden columns associated with the specified worksheet.

    Adding columns on the returned HiddenColumnCollection instance will not actually hide columns in the worksheet. After modifying the hidden columns in this collection, the apply method of the CustomView will hide or unhide the columns.

    Throws

    ArgumentNullException 'worksheet' is null.

    Returns

    Null if saveHiddenRowsAndColumns is False or if the worksheet does not belong to the workbook associated with this custom view; otherwise, the collection of hidden columns associated with the worksheet.

    See

    Parameters

    • worksheet: Worksheet

      The worksheet whose associated hidden columns are to be retrieved.

    • Optional createIfNull: boolean

      True to create the hidden column if it has not yet been allocated of the Worksheet. The options will be initialized based on the current state. Note the options should only have been null if there were no options for the Worksheet when the Workbook was loaded. Also this will not allocate the collection unless the saveHiddenRowsAndColumns is true.

    Returns HiddenColumnCollection

  • Gets the hidden rows associated with the specified worksheet.

    Adding rows on the returned HiddenRowCollection instance will not actually hide rows in the worksheet. After modifying the hidden rows in this collection, the apply method of the CustomView will hide or unhide the rows.

    Throws

    ArgumentNullException 'worksheet' is null.

    Returns

    Null if saveHiddenRowsAndColumns is False or if the worksheet does not belong to the workbook associated with this custom view; otherwise, the collection of hidden rows associated with the worksheet.

    See

    Parameters

    • worksheet: Worksheet

      The worksheet whose associated hidden rows are to be retrieved.

    • Optional createIfNull: boolean

      True to create the hidden column if it has not yet been allocated. The options will be initialized based on the current state of the Worksheet. Note the options should only have been null if there were no options for the Worksheet when the Workbook was loaded. Also this will not allocate the collection unless the saveHiddenRowsAndColumns is true.

    Returns HiddenRowCollection

  • Gets the print options associated with the specified worksheet.

    Setting properties on the returned PrintOptions instance will not change the actual print settings of the worksheet. After setting properties, the apply method of the CustomView will apply them to the worksheet.

    Throws

    ArgumentNullException 'worksheet' is null.

    Returns

    Null if savePrintOptions is False or if the worksheet does not belong to the workbook associated with this custom view; otherwise, the print options associated with the worksheet.

    See

    Parameters

    • worksheet: Worksheet

      The worksheet whose associated print options are to be retrieved.

    • Optional createIfNull: boolean

      True to create the print options if it has not yet been allocated. The options will be initialized based on the current state of the Worksheet. Note the options should only have been null if there were no options for the Worksheet when the Workbook was loaded. Also this will not allocate the collection unless the savePrintOptions is true.

    Returns PrintOptions

  • Gets the display options associated with the specified sheet.

    Setting properties on the returned DisplayOptionsBase instance will not change the actual display of the sheet. After setting properties, the apply method of the CustomView will apply them to the sheet.

    Throws

    ArgumentNullException 'sheet' is null.

    Returns

    Null if the sheet does not belong to the workbook associated with this custom view; otherwise, the display options associated with the worksheet.

    See

    Parameters

    • sheet: Sheet

      The sheet whose associated display options are to be retrieved.

    • Optional createIfNull: boolean

      True to create the display options if it has not yet been allocated. The options will be initialized based on the current state of the Sheet. Note the options should only have been null if there were no options for the Sheet when the Workbook was loaded.

    Returns DisplayOptionsBase

  • Gets the print options associated with the specified sheet.

    Setting properties on the returned PrintOptionsBase instance will not change the actual print settings of the sheet. After setting properties, the apply method of the CustomView will apply them to the sheet.

    Throws

    ArgumentNullException 'sheet' is null.

    Returns

    Null if savePrintOptions is False or if the sheet does not belong to the workbook associated with this custom view; otherwise, the print options associated with the sheet.

    See

    Parameters

    • sheet: Sheet

      The sheet whose associated print options are to be retrieved.

    • Optional createIfNull: boolean

      True to create the print options if it has not yet been allocated. The options will be initialized based on the current state of the Sheet. Note the options should only have been null if there were no options for the Sheet when the Workbook was loaded. Also this will not allocate the collection unless the savePrintOptions is true.

    Returns PrintOptionsBase

  • Parameters

    • item1: any
    • item2: any

    Returns number

  • Parameters

    • item1: any
    • item2: any

    Returns number

  • Parameters

    • item1: any
    • item2: any

    Returns boolean

  • Parameters

    • a: any
    • b: any

    Returns boolean

  • Parameters

    • obj: any

    Returns any[]

  • Parameters

    • obj: any

    Returns any[]

  • Parameters

    • obj: any

    Returns number

  • Parameters

    • a: any
    • b: any

    Returns boolean