If Application.Active Then MsgBox "this is an active windows"Else MsgBox "this is not an active windows"End If