Sub GetWindowInfo() Dim lState As Long
lState = Application.WindowState
Select Case lState
Case xlMaximized
Debug.Print "Window is maximized."
Case xlMinimized
Debug.Print "Window is minimized."
Case xlNormal
Debug.Print "Window is normal." & vbCrLf End Select