Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #If VBA7 Then
- Private Declare PtrSafe Function GetInputState Lib "user32" () As LongPtr
- #Else
- Private Declare Function GetInputState Lib "user32" () As Long
- #End If
- #If VBA7 Then
- Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal ms As LongPtr)
- #Else
- Private Declare Sub Sleep Lib "kernel32" (ByVal ms As Long)
- #End If
- Private Function F_GetHTMLDoc2(ByVal URL As String) As HTMLDocument
- Dim HTML As MSHTML.HTMLDocument
- Set HTML = New MSHTML.HTMLDocument
- Dim myDocument As MSHTML.HTMLDocument
- Set myDocument = HTML.createDocumentFromUrl(URL, vbNullString)
- Do While HTML.ReadyState <> "complete"
- If GetInputState() = True Then DoEvents
- Sleep 1
- Loop
- Set F_GetHTMLDoc2 = myDocument
- Set HTML = Nothing
- Set myDocument = Nothing
- End Function
Add Comment
Please, Sign In to add comment