Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi there.
I've read a fair number of postings on the web about this, but still can't seem to get it to work properly. Basically, I'm trying to open a HTML page (over the network) in a WebBrowser window. I call a sub from my code, which is as follows: Sub ShowWebBrowserIE() Dim intI As Integer UserForm1.Show UserForm1.WebBrowser1.Navigate ("file:///K:/users/tf/t1009.htm") DoEvents Do Until (UserForm1.WebBrowser1.ReadyState = READYSTATE_LOADED) DoEvents Loop MsgBox "Should be done" End Sub The above does not seem to load my page. I have also tried READYSTATE_COMPLETE, but this seems to cause my session to hang (although does load the page). The above examples are consistent with the methods recommended on the web. Can anyone advise as to what might be going on? Any help would be very much appreciated. Please post your responses to this channel. Many thanks in advance, David |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This works. (I changed 'UserForm1.Show' - 'UserForm1.Show 0')
--------------------------------------------- Sub ShowWebBrowserIE() Dim intI As Integer UserForm1.Show 0 UserForm1.WebBrowser1.Navigate ("file:///K:/users/tf/t1009.htm") DoEvents Do Until (UserForm1.WebBrowser1.ReadyState = READYSTATE_LOADED) DoEvents Loop MsgBox "Should be done" End Sub "David" wrote in message ... Hi there. I've read a fair number of postings on the web about this, but still can't seem to get it to work properly. Basically, I'm trying to open a HTML page (over the network) in a WebBrowser window. I call a sub from my code, which is as follows: Sub ShowWebBrowserIE() Dim intI As Integer UserForm1.Show UserForm1.WebBrowser1.Navigate ("file:///K:/users/tf/t1009.htm") DoEvents Do Until (UserForm1.WebBrowser1.ReadyState = READYSTATE_LOADED) DoEvents Loop MsgBox "Should be done" End Sub The above does not seem to load my page. I have also tried READYSTATE_COMPLETE, but this seems to cause my session to hang (although does load the page). The above examples are consistent with the methods recommended on the web. Can anyone advise as to what might be going on? Any help would be very much appreciated. Please post your responses to this channel. Many thanks in advance, David |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi David
What happens is that the code shows userform1 and then waits until the form is unloaded by the user before proceeding. Try simply Sub ShowWebBrowserIE() UserForm1.Show End Sub And in the userform module: Private Sub UserForm_Activate() WebBrowser1.Navigate ("file:///K:/users/tf/t1009.htm") End Sub Forget the readystate stuff, it's just noise. HTH. Best wishes Harald "David" skrev i melding ... Hi there. I've read a fair number of postings on the web about this, but still can't seem to get it to work properly. Basically, I'm trying to open a HTML page (over the network) in a WebBrowser window. I call a sub from my code, which is as follows: Sub ShowWebBrowserIE() Dim intI As Integer UserForm1.Show UserForm1.WebBrowser1.Navigate ("file:///K:/users/tf/t1009.htm") DoEvents Do Until (UserForm1.WebBrowser1.ReadyState = READYSTATE_LOADED) DoEvents Loop MsgBox "Should be done" End Sub The above does not seem to load my page. I have also tried READYSTATE_COMPLETE, but this seems to cause my session to hang (although does load the page). The above examples are consistent with the methods recommended on the web. Can anyone advise as to what might be going on? Any help would be very much appreciated. Please post your responses to this channel. Many thanks in advance, David |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you both very much.
Harald, I have taken your advice and done this...seems to work fine now! Most appreciated, David "Harald Staff" wrote: Hi David What happens is that the code shows userform1 and then waits until the form is unloaded by the user before proceeding. Try simply Sub ShowWebBrowserIE() UserForm1.Show End Sub And in the userform module: Private Sub UserForm_Activate() WebBrowser1.Navigate ("file:///K:/users/tf/t1009.htm") End Sub Forget the readystate stuff, it's just noise. HTH. Best wishes Harald "David" skrev i melding ... Hi there. I've read a fair number of postings on the web about this, but still can't seem to get it to work properly. Basically, I'm trying to open a HTML page (over the network) in a WebBrowser window. I call a sub from my code, which is as follows: Sub ShowWebBrowserIE() Dim intI As Integer UserForm1.Show UserForm1.WebBrowser1.Navigate ("file:///K:/users/tf/t1009.htm") DoEvents Do Until (UserForm1.WebBrowser1.ReadyState = READYSTATE_LOADED) DoEvents Loop MsgBox "Should be done" End Sub The above does not seem to load my page. I have also tried READYSTATE_COMPLETE, but this seems to cause my session to hang (although does load the page). The above examples are consistent with the methods recommended on the web. Can anyone advise as to what might be going on? Any help would be very much appreciated. Please post your responses to this channel. Many thanks in advance, David |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Glad to hear that David. Thanks for the feedback.
Best wishes Harald "David" skrev i melding ... Thank you both very much. Harald, I have taken your advice and done this...seems to work fine now! Most appreciated, David |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|