April 2006
Beginner
1114 pages
98h 16m
English
The Application object provides a Windows collection that lets you open, arrange, resize, and close Excel’s child windows. For example, the following code opens a new child window and then cascades the open windows for the active workbook:
Sub OpenCascadeWindows( )
ActiveWindow.NewWindow
Application.Windows.Arrange xlArrangeStyleCascade, True
End SubYou close and maximize child windows using methods on the Window object. For example, the following code closes the window opened in the preceding code and restores the original window to a maximized state in Excel:
Sub CloseMaximize( )
ActiveWindow.Close
ActiveWindow.WindowState = xlMaximized
End SubClosing the last child window for a workbook also closes the workbook.
Finally, you can control the Excel parent window using the Application object’s WindowState and DisplayFullScreen properties:
Sub ChangeExcelWindowState( )
Application.WindowState = xlMaximized
API.Sleep 1000
Application.WindowState = xlMinimized
API.Sleep 1000
Application.WindowState = xlNormal
API.Sleep 1000
Application.DisplayFullScreen = True
API.Sleep 1000
Application.DisplayFullScreen = False
End SubRead now
Unlock full access