If statement for calling modules
Posted on 2004-10-27
I have code that populates a listbox if there is more than one IE window that has "View" in the title. I am trying to expand on that code to make an if...then statement that will do these things:
If > 1 IE window with "View" in the title, populate listbox
If only one IE window with "View" in the title, continue to Call fEnumWindows
If there are not any IE windows with "View" in the title, pop a msgbox indicating such.
The code below seems to perform all three actions and not correctly jump to the appropriate if...then.
Any help is appreciated.
Dim IE As New InternetExplorer
Dim SH As New ShellWindows
For Each IE In SH
If InStr(1, IE.Document.Title, "View", vbTextCompare) > 1 Then
MsgBox "Opening listbox"
ElseIf InStr(1, IE.Document.Title, "View", vbTextCompare) = Null Then MsgBox "There are tickets displayed on the screen."
MsgBox "Will now update the only open ticket"