(Solved) – VBA Excel to find searched tab in Internet explorer

  • by

Below code is working fine only one thing is missing is that the code doesn’t go to the searched tab in IE.

With CreateObject("Shell.Application").Windows
    If .Count > 0 Then
        Set IE = .Item(0)
        Set objShell = CreateObject("Shell.Application")
        IE_count = objShell.Windows.Count
        For x = 0 To (IE_count - 1)
            On Error Resume Next
            my_url = objShell.Windows(x).document.Location
            If my_url Like Sheets("Transfer Agency").Range("AB1") & "*" Then
                Set IE = objShell.Windows(x)
                '**How to activate/select the searched tab in IE**
                Exit For
            End If
        Set IE = CreateObject("InternetExplorer.Application")
        IE.Visible = True
        IE.navigate Sheets("Transfer Agency").Range("AB1"), CLng(2048)
        Set IE = Nothing
    End If
End With

Leave a Reply

Your email address will not be published. Required fields are marked *