Wait for a page to load

Public Function func_waitForPage(objectref)

   Dim strResult
   Dim intloopcounter
   strResult=False
   Set wshell = CreateObject("WScript.Shell")
   wShell.Sendkeys("^{HOME}")
   For intloopcounter = 1 to 3
    If objectref.Exist Then
    sub_VerifyErrorNumber "wait for page"
   strResult = True
   Exit For
    End If
   Next
 
   If strResult <> True Then
    func_waitForPage = False
 Else
  func_waitForPage = True
   End If
End Function