Share via


Window Object

Multiple objects
Window
Multiple objects

Represents a window. Many worksheet characteristics, such as scroll bars and gridlines, are actually properties of the window. The Window object is a member of the Windows collection. Each worksheet has a unique Window object. Code can only access the window for the active sheet of the workbook. In other words, although the Windows collection states that there is only one Window object, there are, in fact, multiple Window objects, but you may only access the Window object for the active sheet.

Using the Window object

The following properties return a Window object.

The Spreadsheet object's ActiveWindow property.

The Windows collection's Item property.

The following example hides the row and column headings in the active window of Spreadsheet1.

Sub HideHeadings()

   Spreadsheet1.ActiveWindow.DisplayColumnHeadings = False
   Spreadsheet1.ActiveWindow.DisplayRowHeadings = False

End Sub

The following example moves column C so that it's the leftmost column in the window.

Spreadsheet1.ActiveWindow.ScrollColumn = 3

Properties | ActiveCell Property | ActivePane Property | ActiveSheet Property | Application Property | ColumnHeadings Property | DisplayColumnHeadings Property | DisplayCustomHeadings Property | DisplayGridlines Property | DisplayHeadings Property | DisplayHorizontalScrollBar Property | DisplayRowHeadings Property | DisplayVerticalScrollBar Property | DisplayWorkbookTabs Property | DisplayZeros Property | EnableResize Property | FreezePanes Property | GridlineColor Property | GridlineColorIndex Property | Height Property | Index Property | Left Property | Panes Property | Parent Property | RangeSelection Property | RowHeadings Property | ScrollColumn Property | ScrollRow Property | SelectedSheets Property | Selection Property | TabRatio Property | Top Property | Type Property | UsableHeight Property | UsableWidth Property | ViewableRange Property | Visible Property | VisibleRange Property | Width Property | WindowNumber Property

Methods | LargeScroll Method | PointsToScreenPixelsX Method | PointsToScreenPixelsY Method | RangeFromPoint Method | ResetHeadings Method | ScrollIntoView Method | SmallScroll Method

Parent Objects | Heading Object | Headings Collection | ISpreadsheet Object | Pane Object | Panes Collection | Spreadsheet Object | Windows Collection

Child Objects | Headings Object | Pane Object | Panes Object | Range Object | Sheets Object | Workbook Object | Worksheet Object