Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default List all internet explorer (or other) windows (and close them)

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 284
Default List all internet explorer (or other) windows (and close them)

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Impossible to close excel without saving message in internet explorer tinftinf Excel Programming 2 August 28th 07 05:38 PM
Close all internet explorer windows [email protected] Excel Programming 2 July 5th 07 03:44 PM
Excel 2002 - Internet Explorer Windows opening up uncontrollably Mr. Low Excel Discussion (Misc queries) 0 November 3rd 06 02:19 PM
Excel 2002 - Internet Explorer Windows opening up uncontrollably Mr. Low Excel Worksheet Functions 0 November 3rd 06 01:25 PM
Close an Internet Explorer browser window [email protected] Excel Programming 1 July 5th 04 06:25 PM


All times are GMT +1. The time now is 12:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"