Function WaitPageLoading(myPage) On error resume next While myPage.Object.readyState <> "complete" Wend End Function