Posts by Bundi

    Re: Find correct tab in Internet Explorer and activate it

    Thank you John for the code.

    I tried it in my intended application, but I get "Run Time Error '91': Object variable or With block variable not set " and it points to this line

    Set IEtabPattern = IEtab.GetCurrentPattern(UIA_LegacyIAccessiblePatternId)

    This I got after changing the IE tab name (ozgrid) to the page I need in this line

    Set IE = Find_and_Activate_IE_Tab("*ozgrid*")

    When trying to run it without changing the IE tab name, I get this error "Run-time error '-2147467259 (80004005)'" Automation error Unspecified error.

    And when doing debug, it points to this line

    If TypeName(IE.document) = "HTMLDocument" Then

    Not sure really what is causing it.
    Thanks for your help


    I need to find a specific tab in an open instance in Internet Explorer. I found a macro to bring Internet Explorer to the front, but then I need to find a specific tab and then activate it.
    I have found macros that can verify that the tab is open, but I haven't managed to merge any of those codes into the macro I have for bringing IE to the front.

    This is the macro I have for bringing IE to the front:
    (Found at "Happy Codings" site)

    I have seen some codes that uses SendKeys, but I would prefer to avoid that. And instead somehow loop through the names of the tabs to locate the correct one.

    I have also posted the question some time ago here:…ance-of-Internet-Explorer

    Thank you,