Window object (Excel)
Represents a window.
Remarks
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.
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.
Example
Use Windows (index), where index is the window name or index number, to return a single Window object. The following example maximizes the active window.
Windows(1).WindowState = xlMaximized
Note that the active window is always Windows(1)
.
The window caption is the text shown in the title bar at the top of the window when the window isn't 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 doesn't 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
Methods
- Activate
- ActivateNext
- ActivatePrevious
- Close
- LargeScroll
- NewWindow
- PointsToScreenPixelsX
- PointsToScreenPixelsY
- PrintOut
- PrintPreview
- RangeFromPoint
- ScrollIntoView
- ScrollWorkbookTabs
- SmallScroll
Properties
- ActiveCell
- ActiveChart
- ActivePane
- ActiveSheet
- ActiveSheetView
- Application
- AutoFilterDateGrouping
- Caption
- Creator
- DisplayFormulas
- DisplayGridlines
- DisplayHeadings
- DisplayHorizontalScrollBar
- DisplayOutline
- DisplayRightToLeft
- DisplayRuler
- DisplayVerticalScrollBar
- DisplayWhitespace
- DisplayWorkbookTabs
- DisplayZeros
- EnableResize
- FreezePanes
- GridlineColor
- GridlineColorIndex
- Height
- HWnd
- Index
- Left
- OnWindow
- Panes
- Parent
- RangeSelection
- ScrollColumn
- ScrollRow
- SelectedSheets
- Selection
- SheetViews
- Split
- SplitColumn
- SplitHorizontal
- SplitRow
- SplitVertical
- TabRatio
- Top
- Type
- UsableHeight
- UsableWidth
- View
- Visible
- VisibleRange
- Width
- WindowNumber
- WindowState
- Zoom
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기