Shell.Application not returning all windows
-
I wrote a vbscript that closes Internet explorer windows. The main reason i'm doing it this way it to get the LocationURL property of the objIE object before I call Quit on it. The problem is that not all windows close this way. Any suggestions?
Set objShell = CreateObject("Shell.Application") Set objShellWindows = objShell.Windows dim i, nCount nCount = objShellWindows.Count nCount = nCount - 1 for i = 0 to nCount dim objIE set objIE = objShellWindows.Item(i) if (not objIE is nothing) then objIE.Quit end if next
-
I wrote a vbscript that closes Internet explorer windows. The main reason i'm doing it this way it to get the LocationURL property of the objIE object before I call Quit on it. The problem is that not all windows close this way. Any suggestions?
Set objShell = CreateObject("Shell.Application") Set objShellWindows = objShell.Windows dim i, nCount nCount = objShellWindows.Count nCount = nCount - 1 for i = 0 to nCount dim objIE set objIE = objShellWindows.Item(i) if (not objIE is nothing) then objIE.Quit end if next
What do you mean by "not all windows close this way"? Are you talking about close JUST the IE windows or all applications? Also, before you close the IE window, you might want to try checking the
.Busy
property and wait until the borwser window is finished. I'm not syaing that this will solve the problem, but it might... RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome