I have a script where I create an IE window through CreateObject(\"InternetExplorer.Application\"). The problem is, whenever I run this script, it always opens behi
CreateObject(\"InternetExplorer.Application\")
I found the sequence affects the behavior. Don't make IE visible until after it has finished loading.
Set ie = CreateObject("InternetExplorer.Application") ie.Navigate "http://www.google.com" While ie.Busy Or ie.ReadyState <> READYSTATE_COMPLETE DoEvents Wend ie.visible = True DoEvents