WorkbookBase.Windows Property

Gets a Microsoft.Office.Interop.Excel.Windows collection that represents all the windows in the workbook.

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

Syntax

'Declaration
Public ReadOnly Property Windows As Windows
public Windows Windows { get; }

Property Value

Type: Microsoft.Office.Interop.Excel.Windows
A Microsoft.Office.Interop.Excel.Windows collection that represents all the windows in the workbook.

Remarks

This property returns a collection of both visible and hidden windows.

Examples

The following code example uses the Windows property to display formulas, gridlines, and the outline of the current workbook.

This example is for a document-level customization.

Private Sub SetWindowOptions()
    Me.Windows(1).DisplayFormulas = True 
    Me.Windows(1).DisplayGridlines = True 
    Me.Windows(1).DisplayOutline = True 
End Sub
private void SetWindowOptions()
{
    this.Windows[1].DisplayFormulas = true;
    this.Windows[1].DisplayGridlines = true;
    this.Windows[1].DisplayOutline = true;
}

.NET Framework Security

See Also

Reference

WorkbookBase Class

Microsoft.Office.Tools.Excel Namespace