I am running the following Autohotkey code that works all the time on good days and most of the time on bad days (slow internet and or computer).
079: Sleep,500
081: ie_win.document.all.lbContentIframe.contentWindow.document.all.btnOkId.click()
082: Sleep,500
083: While,ie_win.document.all.lbContentIframe.contentWindow.document.readyState <> "complete"
084: Sleep,100
The error I am getting is for line 83
Description: Access is denied.
HelpFile: C:\Windows\System32\mshtml.hlp
Specifically: document
Is that because the lbContentIframe Iframe document isn't loaded yet? Previously I have tried
while !ie_win.document.getelementbyid("lbContentIframe")
sleep, 100
and I haven't received any errors due to that line. Do I need to do that every time the Iframe might be refreshing before trying to check if it is done loading via the readyState property?
Also, once I get the above error it never starts working again no matter how many times I try. It is almost like the ie_win handle gets corrupted.