Close all IE browsers

'// This will close all IE browsers
Public Function closeAllBrowsers
Dim oDesc, x

'Create a description object
Set oDesc = Description.Create
oDesc( "micclass" ).Value = "Browser"

'Loop through the collection and close each browser
If Desktop.ChildObjects(oDesc).Count > 0 Then
For x = 0 to Desktop.ChildObjects(oDesc).Count - 1
Browser( "creationtime:=" & x ).Close
Next
End If
End Function

comment 1 comments:

Satish kumar Bammidi on September 10, 2014 at 12:51 AM said...

sorry to say this but the code doesnt work

in the forloop you can say it as "Creationtime:=0" instead of "creationtime:="&x

  • Recent Posts

     
    © QTPCode | Design by Blog template in collaboration with Concert Tickets, and Menopause symptoms
    Powered by Blogger