Application.WindowHide method (Project)

Hides a window.

Syntax

expression. WindowHide( _Name_ )

expression A variable that represents an Application object.

Parameters

Name Required/Optional Data type Description
Name Optional String The name of the window to hide. The name of a window is the exact text that appears in the title bar of the window. The default is the active window.

Return value

Boolean

Example

The following example hides all windows except the active window.

Sub HideAllWindowsExceptActive() 
 
 Dim I As Long ' Index for For...Next loop 
 
 For I = 1 To Windows.Count 
 If Windows(I) <> ActiveWindow And Windows(I).Visible Then 
 
 WindowHide Windows(I).Caption 
 End If 
 Next I 
 
End Sub

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.