Dim objWindows As ShellWindows Dim objIE As InternetExplorer Dim lngLoop As Long
Set objWindows = New ShellWindows For lngLoop = objWindows.Count - 1& To 0& Step -1& Set objIE = objWindows.Item(lngLoop) If ("HTMLDocument" = TypeName(objIE.Document)) Then Call objIE.Quit End If Set objIE = Nothing Next Set objWindows = Nothing