View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
The Dude The Dude is offline
external usenet poster
 
Posts: 10
Default List all internet explorer (or other) windows (and close them)

Steve you rule!
Thanks for the tip, it works great.

Obvioulsy I had forgotten about the .quit at the end so I ended up with 15
instances of Winword, but I got to learn about the Late Binding method :)

Thanks again :)

"Steve Yandl" wrote:

One method is to start a hidden instance of the Word application and take
advantage of its 'tasks' property. That will return a collection of running
applications. The 'name' property for each task returns the friendly name
(the name you would see in the title bar of the window as opposed to the
process name which might be different). Limit your search to tasks which
are visible and then use the InStr function to isolate those whose name
property gives a string containing the string "Internet Explorer". Use the
'close' method of the task to close all the IE windows and then shut down
the hidden instance of Word.

Steve



"The Dude" <f_com2°AT°yahoo°DOT°fr wrote in message
...
Hello everyone,
and Merry christmas :)

I have a question regarding IE control from Excel.
Let's say a user has to close all internet explorer windows that he did
not
create (or only the ones with a specific name), how could you
select/list/close them?

I have tried the getobject late binding but it does not work with IE
applications... as for AppActivate it works well but the sendkeys Alt+F4
messes up with the numlock key and sometimes bugs.

Thanks for any info ;)
T D