Share via


WorkbookBase.CustomViews Property

Definition

Gets a CustomViews collection that represents all the custom views for the workbook.

public:
 property Microsoft::Office::Interop::Excel::CustomViews ^ CustomViews { Microsoft::Office::Interop::Excel::CustomViews ^ get(); };
public Microsoft.Office.Interop.Excel.CustomViews CustomViews { get; }
member this.CustomViews : Microsoft.Office.Interop.Excel.CustomViews
Public ReadOnly Property CustomViews As CustomViews

Property Value

A CustomViews collection that represents all the custom views for the workbook.

Examples

The following code example uses the CustomViews property to add a custom view named "Summary" to the current workbook, and then programmatically displays the Custom Views dialog to demonstrate that the new custom view was created.

This example is for a document-level customization.

private void AddCustomView()
{
    this.CustomViews.Add("Summary", true, true);

    this.Application.Dialogs[Excel.XlBuiltInDialog.xlDialogCustomViews].Show();
}
Private Sub AddCustomView()
    Me.CustomViews.Add("Summary", True, True)
    Me.Application.Dialogs( _
        Excel.XlBuiltInDialog.xlDialogCustomViews).Show()
End Sub

Applies to