|
-
Nov 6th, 2008, 09:47 AM
#1
Thread Starter
Don't Panic!
[RESOLVED] [Access/Excel] Finding an open IE and...
...how to find more than one should there be say three open on a desktop
how would I do this using basic controls and VBA in Access/Excel.
The Posts on here and on the interweb appear to create new ie instances.
Has anyone done this?
Last edited by Ecniv; Nov 7th, 2008 at 03:57 AM.
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Nov 6th, 2008, 12:05 PM
#2
Fanatic Member
Re: {Access/Excel] Finding an open IE and...
Yes, I've done this. You have to loop through the SHDocVw.ShellWindows object. That will contain all IE and explorer windows open. This short sub gets the very first IE window. The reference for early binding is "Microsoft Internet Controls."
Code:
Private Sub GetIeWindow(ByRef ie As InternetExplorer)
Dim SW As New SHDocVw.ShellWindows
Dim i As Long
Dim s As String
i = SW.Count
For i = 0 To i - 1
On Error Resume Next
s = SW(i).Document.Title
If Err.Number > 0 Then
Err.Clear
Else
Set ie = SW(i)
Exit For
End If
Next
End Sub
-
Nov 7th, 2008, 03:59 AM
#3
Thread Starter
Don't Panic!
Re: [Access/Excel] Finding an open IE and...
Thanks for that. I found a similar post:
Other post on another place
Code:
Dim sws As SHDocVw.ShellWindows
Dim ie As SHDocVw.InternetExplorer
Set sws = New SHDocVw.ShellWindows
For Each ie In sws
Debug.Print ie.LocationURL
Next
Set ie = Nothing
Set sws = Nothing
Then I came up with the above. However, the thing I wanted to do turns out not o be a web page, but to be an SWE (flash?) so I don't think I can do what I wanted to do.
I will use this at some point in the future though so thank you for posting 
How wouold we find these things? Seems not to be easily found online through ms... in fact the msdn site seems to have changed...
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|