Jump to content

_IEQuit is not removing object


Recommended Posts

Hi, 

I am new to AutoIt. I have used some the autoIt functions to explore it.

In that when i use _IECreate to open browser and _IEQuit to close the browser, it opens an IE browser and sometimes it is not closing IE browser and also IE object is not releasing, again and again it keeps on adding iexplore.exe in task manager. It slows down my system. Anything I am missing here to close the browser?

Kindly help me to resolve this.

My Code:

#include <IE.au3>
#include <MsgBoxConstants.au3>

Local $oIE = _IECreate("www.google.com")

Sleep(1000);
_IEQuit($oIE)

Link to comment
Share on other sites

Hi,

Please use the <> code tags when posting code..:)

Try to add some error checking to see where it hangs:

#include <IE.au3>
;~ #include <MsgBoxConstants.au3>    not needed

Local $oIE = _IECreate("www.google.com")

$hWnd = WinWait("Google", "", 1)
If WinExists($hWnd) Then
    MsgBox(0, "Found", "IE window found - Closing...")
    _IEQuit($oIE)
        If @error Then
            MsgBox(0, 'error', @error )  ; if you get this message check the number in the helpfile for its value
        EndIf

Else
    MsgBox(0, "error", "IE window not found")
EndIf

 

Edited by l3ill
updated code
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...