COM Error Msg When Relauncing Internet Explorer

Get help with using AutoHotkey and its commands and hotkeys
Vaklev
Posts: 47
Joined: 04 Mar 2019, 13:58

COM Error Msg When Relauncing Internet Explorer

Post by Vaklev » 13 Aug 2019, 11:13

I get the following messege after I close my active internet explorer window and run my COM command to relaunch it:

"Error: 0x800704A6 - A system shutdown has already been scheduled.
---> Line# 078: wb:=ComOjbCreate("InternetExplorer.Application")
Continue Running script? Yes No"

Here is my code:

Code: Select all

^+g::
Run, "H:\apps\xp\Desktop\AHK\FINTRAC AHK\FINTRAC.exe"
wb := ComObjCreate("InternetExplorer.Application")
wb.Navigate("cbr.bankofamerica.com")
Loop, 100
{
    sleep 100
    ImageSearch fx,fy, 264,160, 602,220, fintrac.png
    if ErrorLevel = 0
    {
        loop, 3{
        sleep 333
        MouseMove 382,182
        MouseClick left
        break
        }
        break
    }
}

MouseMove 624,193
sleep 500
MouseClick left
    
loop, 100
{
    ImageSearch fx,fy, 87,78,204,162, efto.png
    if ErrorLevel = 0
    {
        MouseMove 123,103
        MouseClick left
        break
    }
}


return
And internet explorer will not launch until I completely turn quit out of the AHK script and relaunch it which is a problem because my count on my GUI will reset if I close AHK (seperate script). Is there a way around this msg and to prevent this error from happening when I launch IE after closing?

awel20
Posts: 211
Joined: 19 Mar 2018, 14:09

Re: COM Error Msg When Relauncing Internet Explorer

Post by awel20 » 13 Aug 2019, 12:28

This only happens for me if I close IE soon after starting it. Presumably IE delays registering itself with the system to help improve its startup speed. As a result, it takes IE a while to close if it has just been opened.

In the past I have just used try/catch to retry until I can launch IE again.

Code: Select all

g::
	tryNumber := 1
TryAgain:
	try
		wb := ComObjCreate("InternetExplorer.Application")
	catch err
	{
		ToolTip, % "Internet explorer is still shutting down. Retry # " tryNumber "`n" err.message
		tryNumber++
		SetTimer, TryAgain, -2000
		return
	}
	ToolTip
	wb.Navigate("google.com")
	wb.Visible := true
return

Esc::ExitApp
Last edited by awel20 on 13 Aug 2019, 12:29, edited 1 time in total.

User avatar
tank
Posts: 2850
Joined: 28 Sep 2013, 22:15
Facebook: charlie.simmons.7334
Google: ttnnkkrr
GitHub: ttnnkkrr
Location: Irving TX
Contact:

Re: COM Error Msg When Relauncing Internet Explorer

Post by tank » 13 Aug 2019, 12:29

what gui
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
https://www.facebook.com/ahkscript.org
If you have forum suggestions please submit a pull request
Check Out WebWriter
Thanks Tank :thumbup:

User avatar
Sir Teddy the First
Posts: 94
Joined: 05 Aug 2019, 12:31
Contact:

Re: COM Error Msg When Relauncing Internet Explorer

Post by Sir Teddy the First » 14 Aug 2019, 03:03

Sometimes there's also the problem that if you launched a hidden IE-window too many times the OS will prevent you from launching any additional windows because they are all open in the background, which will result in a similar error message.
If that's the case, check the task manager to close them.
:eh: :think:

Post Reply

Return to “Ask For Help”