PDA

View Full Version : Solved: SHDocVw.ShellWindows Doesent see all IE instances



champagne_ch
06-02-2013, 03:25 AM
Hello,

I have an issue that has just arrisen with IE automation.

in brief.. the following code does not see all of the IE windows. In Fact currently it only sees 2 of 9.

Sub Main()
'Requires reference to Microsoft Internet Controls
Dim SWs As SHDocVw.ShellWindows, vIE As SHDocVw.InternetExplorer

'Establish link to IE application
Set SWs = New SHDocVw.ShellWindows

For Each vIE In SWs

Debug.Print "URL:'" & vIE.Name & "'"
Debug.Print "URL:'" & vIE.LocationURL & "'"

Next

Set SWs = Nothing
Set vIE = Nothing
End Sub
output is:

URL:'Windows Internet Explorer'
URL:''
URL:'Windows Internet Explorer'
URL:'LINK FOUND BUT CANNOT POST'


There are in fact 9 IE windows open. And i do mean windows not tabs.

N.B.> one of the returns has no URL.. however when I view the pages all do..

All was working as module within Outlook. however I did get several IE crashes. (which did not occur from access) I have thus put into VB6 with no reboot as yet.

Any ideas what may be causing this issue.

The reason I am using this loop through windows is I have a htmldoc that opens a 2nd window with links to data I want to extract. Data is only produced when link is clicked as is encypted/ decrypted via javascript within HTML. If there wasd another way to capture this second screen I would be happier to use it.

I hope somebody can assist.

champagne_ch
06-02-2013, 03:32 AM
Also note that I say 9 windows.. I have since closed these and I.E. is still taking memory. I presume 1 or more windows are hidden. hwever code only reports 1 window. I assume given 250Mb taken of mem that at least 10 more windows are open yet result from function is:


URL:'Windows Internet Explorer'
URL:''



I have now closed down the processes in taskmanager however the following result is still returned..



URL:'Windows Internet Explorer'
URL:''



however i close down outlook (the prev vba host) and nothing is returned.

champagne_ch
06-02-2013, 04:01 AM
Ok.. So I have gone back and tried the code in access... No issues and windows are found. Could this be a permissions problem?

champagne_ch
06-02-2013, 05:37 AM
I have run as administrator and this still doesent solve.

I think the issue lies within the fact that the process is created via vb..


SOLVED.. Issue occurs because in debug. Once exe is created issue does not occur.