Is there a foolproof way for the script to wait till the Internet explorer is completely loaded?
Both oIE.Busy and / or oIE.ReadyState are
I have for a very long time been successfully using:
While IE.readyState <> 4 Or IE.Busy: DoEvents: Wend
It has been working perfectly until today, when I changed my PC and switched to Windows 10 and Office 16. Then it started working on some cases, but there were times when the loop was not completed. Neither one of the conditions in the loop was reached, so the loop was ENDLESS.
After a lot of Googling, I have tried many suggestions until I found the solution in this post: Excel VBA Controlling IE local intranet
The solution is to add the URL to the trusted sites list in Internet Explorer Security tab. Finally!