Hello People,
I am very new to VBA. Sorry for my lack of knowledge.
But currently I'm using a simple code to wait for the webpage to load. I'm using:

Do While IE.Busy
DoEvents
Loop

Do While IE.readystate <> 4
Do Events
Loop



But still the webpage does not get fully loaded. I got a Thread in stack overflow and they said to wait for all JavaScript to load

"Const WAIT_TIMEOUT = 300
Const ERR_TIMEOUT = 1000
Const READYSTATE_COMPLETE = 4

Sub WaitUntilLoaded(ie)
Dim i, j, ready

' wait for page to connect
i = 0
Do Until ie.readyState = READYSTATE_COMPLETE
WScript.Sleep 100
i = i + 1
If i > WAIT_TIMEOUT Then
Err.Raise ERR_TIMEOUT, , "Timeout"
End If
Loop

' wait for document to load
Do Until ie.document.readyState = "complete"
WScript.Sleep 100
i = i + 1
If i > WAIT_TIMEOUT Then
Err.Raise ERR_TIMEOUT, , "Timeout"
End If
Loop

' wait for frames to load
Do
ready = True
For j = 0 To ie.document.frames.Length - 1
If ie.document.frames(j).document.readyState <> "complete" Then
ready = False
WScript.Sleep 100
i = i + 1
If i > WAIT_TIMEOUT Then
Err.Raise ERR_TIMEOUT, , "Timeout"
End If
End If
Next
Loop Until ready
End Sub"

But that is also not working.

Please help me. And sorry for the lack of my knowledge.