none
Finding a tab in Edge using VBA RRS feed

  • Question

  • I have used the following code on windows 7 and IE 9 to find and active tab in IE so that I can fill out a form in the active tab. Now that I have upgraded. The vba code no longer finds the tab. Anyone have any Ideas?

    Function GetIE(sAddress As String) As Object
    Dim objShell As Object, objShellWindows As Object, o As Object
    Dim retVal As Object, sURL As String

        Set retVal = Nothing
        Set objShell = CreateObject("Shell.Application")
        Set objShellWindows = objShell.Windows
        'see if IE is already open
        For Each o In objShellWindows
            sURL = ""
            On Error Resume Next
            sURL = o.Document.Location
            On Error GoTo 0
            If sURL <> "" Then
                  'MsgBox sURL
                  If sURL Like sAddress & "*" Then
                  Set retVal = o
                  Exit For
                End If
            End If
        Next o
    Set GetIE = retVal
    End Function

    Wednesday, September 16, 2015 6:46 PM

All replies

  • Edge doesn't support a COM interface so using VBA is not possible.  Only IE supports it. 

    This is a good description of the capabilities of the MS Edge browser.

    Edge Browser

    Wednesday, September 16, 2015 11:24 PM
  • So if this is the case is there a way to bypass Edge and use IE11 on windows 10?
    Thursday, September 17, 2015 12:50 PM
  • Sure, I just upgraded to 10 and IE11 works fine.  I set it as my default browser.
    Friday, September 18, 2015 2:06 AM