Workbook.CustomViews Property (2007 System)

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

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property CustomViews As CustomViews
'Usage
Dim instance As Workbook 
Dim value As CustomViews 

value = instance.CustomViews
[BrowsableAttribute(false)]
public CustomViews CustomViews { get; }
[BrowsableAttribute(false)]
public:
property CustomViews^ CustomViews {
    CustomViews^ get ();
}
public function get CustomViews () : CustomViews

Property Value

Type: CustomViews
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 Sub AddCustomView()
    Me.CustomViews.Add("Summary", True, True)
    Me.Application.Dialogs( _
        Excel.XlBuiltInDialog.xlDialogCustomViews).Show()
End Sub
private void AddCustomView()
{
    this.CustomViews.Add("Summary", true, true);

    this.Application.Dialogs[Excel.XlBuiltInDialog.xlDialogCustomViews].Show(
        missing, missing, missing, missing, missing, missing, missing, missing,
        missing, missing, missing, missing, missing, missing, missing, missing,
        missing, missing, missing, missing, missing, missing, missing, missing,
        missing, missing, missing, missing, missing, missing);
}

.NET Framework Security

See Also

Reference

Workbook Class

Workbook Members

Microsoft.Office.Tools.Excel Namespace