Hi All experts.
I posted serveral questions here about the WebBrowser and got very good answers to come up the codes below. Thanks all the experts who have helped me earlier!
Need help again: There is a website (see the codes below). When it goes from page1 to page2, or page 2 to page3, the webbrowser's ReadyState becomes READSTATE_COMPLETE, but the webbrowser is not refreshed and still stays at the current page. Then I got error by trying to call the button of the next page.
I tried to use
Do Until frmWB.wb.ReadyState = READYSTATE_COMPLETE And _
Trim(frmWB.wb.LocationURL) <> vCurURL
DoEvents
Loop
It doesn't work either because the website URL doesn't change from page to page.
Is there another way to know how this website fully loaded and refreshed??
Any help would be greatly appreciated!!
== My codes =======================================
Public Sub ProcessCT(ByVal lState As String, _
ByVal lBusSrcName As String)
frmWB.wb.Navigate2 " Do Until frmWB.wb.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
Call frmWB.wb.Document.parentWindow.execScript _
("MM_swapImage('document.layers[\'Logo\'].document.Logo','document.Logo','images/ConcordButton.gif','#932951425980')", "JavaScript")
frmWB.wb.Navigate2 " Do Until frmWB.wb.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
'page 1
frmWB.wb.Document.All("13").Value = "1"
frmWB.wb.Document.All("DFH_ENTER").Click
Do Until frmWB.wb.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
'page 2
frmWB.wb.Document.All("13").Value = "1"
frmWB.wb.Document.All("DFH_ENTER").Click
Do Until frmWB.wb.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
'page 3
frmWB.wb.Document.All("14").Value = lBusSrcName
frmWB.wb.Document.All("DFH_ENTER").Click
Do Until frmWB.wb.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
'Print
frmWB.wb.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER
' Sign-Off
For vCtr = 0 To frmWB.wb.Document.All.length - 1
If UCase(frmWB.wb.Document.All(vCtr).tagName) = "INPUT" Then
If UCase(frmWB.wb.Document.All(vCtr).Value) = _
"SIGN-OFF OF THE CONCORD SYSTEM" Then
frmWB.wb.Document.All(vCtr).Click
End If
End If
Next
End Sub
I posted serveral questions here about the WebBrowser and got very good answers to come up the codes below. Thanks all the experts who have helped me earlier!
Need help again: There is a website (see the codes below). When it goes from page1 to page2, or page 2 to page3, the webbrowser's ReadyState becomes READSTATE_COMPLETE, but the webbrowser is not refreshed and still stays at the current page. Then I got error by trying to call the button of the next page.
I tried to use
Do Until frmWB.wb.ReadyState = READYSTATE_COMPLETE And _
Trim(frmWB.wb.LocationURL) <> vCurURL
DoEvents
Loop
It doesn't work either because the website URL doesn't change from page to page.
Is there another way to know how this website fully loaded and refreshed??
Any help would be greatly appreciated!!
== My codes =======================================
Public Sub ProcessCT(ByVal lState As String, _
ByVal lBusSrcName As String)
frmWB.wb.Navigate2 " Do Until frmWB.wb.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
Call frmWB.wb.Document.parentWindow.execScript _
("MM_swapImage('document.layers[\'Logo\'].document.Logo','document.Logo','images/ConcordButton.gif','#932951425980')", "JavaScript")
frmWB.wb.Navigate2 " Do Until frmWB.wb.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
'page 1
frmWB.wb.Document.All("13").Value = "1"
frmWB.wb.Document.All("DFH_ENTER").Click
Do Until frmWB.wb.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
'page 2
frmWB.wb.Document.All("13").Value = "1"
frmWB.wb.Document.All("DFH_ENTER").Click
Do Until frmWB.wb.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
'page 3
frmWB.wb.Document.All("14").Value = lBusSrcName
frmWB.wb.Document.All("DFH_ENTER").Click
Do Until frmWB.wb.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
frmWB.wb.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER
' Sign-Off
For vCtr = 0 To frmWB.wb.Document.All.length - 1
If UCase(frmWB.wb.Document.All(vCtr).tagName) = "INPUT" Then
If UCase(frmWB.wb.Document.All(vCtr).Value) = _
"SIGN-OFF OF THE CONCORD SYSTEM" Then
frmWB.wb.Document.All(vCtr).Click
End If
End If
Next
End Sub