|
-
Oct 4th, 2000, 07:31 PM
#1
DOes anyone know how to control the webbrowser control such that it only executes a command/statement once?
DocumentComplete, DownloadComplete and NavigateComplete2 seem to execute more than one time.
What I want to do is once the webbrowser has finished loading, it executes another instruction only once.
Any help is appreciated..
-
Oct 4th, 2000, 07:44 PM
#2
All DocumentComplete, DownloadComplete and NavigateComplete2 are pretty much the same. Try putting your code in just one, choose one, doesn't really matter which one and it will only execute once.
-
Oct 5th, 2000, 05:32 AM
#3
4 times
Yes, i did try in with document_complete:
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Debug.Print "yes"
End Sub
It's printing "yes" four times in the intermediate windows, depending on the web source , sometimes three times, twice, etc.
Dunno why?
-
Oct 5th, 2000, 06:17 AM
#4
Try switching it to a different event. Try them all.
Or you could...have a Boolean and if it's True, than you will only do it once..if false, than it hasn't been done yet. If you need help on doing this, just ask.
-
Oct 6th, 2000, 08:10 AM
#5
already tried
Originally posted by Matthew Gates
Try switching it to a different event. Try them all.
Or you could...have a Boolean and if it's True, than you will only do it once..if false, than it hasn't been done yet. If you need help on doing this, just ask.
I've tried using the other events, but the statement is still being executed more than once.
I've also tried using boolean:
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If flag = 0 Then
Debug.Print "yes"
flag = 1
End If
End Sub
but, it's still being executed more than once , I really don't get this....
-
Oct 6th, 2000, 01:47 PM
#6
That's weird, and you only have code in the Webbrowser1_DocumentComplete event?
Because it only fires once for me. I don't have anything DownloadComplete or NavigateComplete2 events, just DocumentComplete.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|