Window Object

Description

Represents a window. Many worksheet characteristics, such as scroll bars and gridlines, are actually properties of the window.

Accessors

The Window object is a member of the Windows collection. The Windows collection for the Application object contains all the windows in the application, whereas the Windows collection for the Workbook object contains only the windows in the specified workbook. Use the NewWindow method to create a new window and add it to the collection.

To access a single member of the collection, use the Windows method with the index number or caption of the window as an argument. Using the Windows method with no object qualifier returns the collection of windows for the application (this is equivalent to Application.Windows). The active window is always Windows(1).

The following example maximizes the active window.


Windows(1).WindowState = xlMaximized

The window caption is the text shown in the title bar at the top of the window when the window is not maximized. The caption is also shown in the list of open files on the bottom of the Windows menu. Use the Caption property to set or return the window caption. Changing the window caption does not change the name of the workbook. The following example turns off cell gridlines for the worksheet shown in the BOOK1.XLS:1 window.


Windows("book1.xls:1").DisplayGridlines = False

Properties

ActiveCell Property, ActiveChart Property, ActivePane Property, ActiveSheet Property, Application Property, Caption Property, Creator Property, DisplayFormulas Property, DisplayGridlines Property, DisplayHeadings Property, DisplayHorizontalScrollBar Property, DisplayOutline Property, DisplayRightToLeft Property, DisplayVerticalScrollBar Property, DisplayWorkbookTabs Property, DisplayZeros Property, FreezePanes Property, GridlineColor Property, GridlineColorIndex Property, Height Property, Index Property, Left Property, OnWindow Property, PageSetup Property, Parent Property, RangeSelection Property, ScrollColumn Property, ScrollRow Property, Selection Property, Split Property, SplitColumn Property, SplitHorizontal Property, SplitRow Property, SplitVertical Property, TabRatio Property, Top Property, Type Property, UsableHeight Property, UsableWidth Property, Visible Property, VisibleRange Property, Width Property, WindowNumber Property, WindowState Property, Zoom Property.

Methods

Activate Method, ActivateNext Method, ActivatePrevious Method, Close Method, LargeScroll Method, NewWindow Method, Panes Method, PrintOut Method, PrintPreview Method, ScrollWorkbookTabs Method, SelectedSheets Method, SetInfoDisplay Method, SmallScroll Method.