O
outforblood74
Ok here's the deal, the for each statment using VB 6 doesn't loop all
the objects. I would like it to close all the IE browsers that are
open, but it doesn't work. And now I'm concerned that its doing this
elsewhere in my code too, and the RETRY trick isn't an option.
Starting with say 16 open IE windows, this doesn't work, it exits the
for next while still having several IE windows open.Dim SWs As New SHDocVw.ShellWindows
Dim IE As SHDocVw.WebBrowser
For Each IE In SWs
IE.Quit
Next
Set SWs = Nothing
Set IE = Nothing
<<<<<<
However as a work around for this case this does work.
Dim SWs As New SHDocVw.ShellWindows
Dim IE As SHDocVw.WebBrowser
RETRY:
For Each IE In SWs
IE.Quit
Next
If SWs.Count <> 0 Then GoTo RETRY
Set SWs = Nothing
Set IE = Nothing
<<<<<<
But as you can see this isn't usable in many cases when you need to
cycle all the objects.
Is this a bug that has a fix or am I just asking for too much?
(Please pardon the multi-post, the previous was in the wrong topic)
the objects. I would like it to close all the IE browsers that are
open, but it doesn't work. And now I'm concerned that its doing this
elsewhere in my code too, and the RETRY trick isn't an option.
Starting with say 16 open IE windows, this doesn't work, it exits the
for next while still having several IE windows open.Dim SWs As New SHDocVw.ShellWindows
Dim IE As SHDocVw.WebBrowser
For Each IE In SWs
IE.Quit
Next
Set SWs = Nothing
Set IE = Nothing
<<<<<<
However as a work around for this case this does work.
Dim SWs As New SHDocVw.ShellWindows
Dim IE As SHDocVw.WebBrowser
RETRY:
For Each IE In SWs
IE.Quit
Next
If SWs.Count <> 0 Then GoTo RETRY
Set SWs = Nothing
Set IE = Nothing
<<<<<<
But as you can see this isn't usable in many cases when you need to
cycle all the objects.
Is this a bug that has a fix or am I just asking for too much?
(Please pardon the multi-post, the previous was in the wrong topic)
