Friday, September 19, 2008

SHDocVw.ShellWindows stopped working on Vista

I have the following code to enumerate running instance of IE 7(not sure if this works with IE6).

Sub TestGetRunningIE()
    Dim sws As SHDocVw.ShellWindows
    Dim ie As SHDocVw.InternetExplorer
    
    Set sws = New SHDocVw.ShellWindows
    For Each ie In sws
        Debug.Print ie.Name
    Next
End Sub
For the above code to work, need to make a reference to shdocvw.dll, see below for the location:
image
When I moved this code in Vista SP1 Business it stopped working. Who would think that this is related to UAC :)... anyway just disable UAC and this code should work again. Note that on one of my machines it is working with UAC on :(....

See this post to disable UAC. This is only one of the methods to disable User Account Control.
~ts

2 comments:

Anonymous said...

Hi Iam Prabhu from chennai,joined today in this forum... :)

Techno Scavenger said...

Thanks for dropping by.