Results 1 to 7 of 7

Thread: Opening multople tabs in IE from Excel and VBA

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5

    Working!

    I just got mine working.

    From Internet Explorer, go to 'Tools', then 'Internet Options'. Select the 'Security' tab, then make sure the checkbox is enabled next to the 'Enable Protected Mode (requires restarting Internet Explorer)' option. Close all Internet Explorer windows, then try your code again.

    I have Windows 7 and am using IE8. My full code is below (I removed my URL's because of the PIP policy my work has, just replace them with yours):

    Sub Passdown_A()
        Dim objIE As SHDocVw.InternetExplorer
        Dim strURL(1 To 14) As String
        Dim i as Integer
        strURL(1) = "URL #1"
        strURL(2) = "URL #2"
        strURL(3)= "URL #3"
        strURL(4)= "URL #4"
        strURL(5)= "URL #5"
        strURL(6)= "URL #6"
        strURL(7) = "URL #7"
        strURL(8) = "URL #8"
        strURL(9) = "URL #9"
        strURL(10) = "URL #10"
        strURL(11) = "URL #11"
        strURL(12) = "URL #12"
        strURL(13) = "URL #13"
        strURL(14) = "URL #14"
        Set objIE = CreateObject("InternetExplorer.Application")
        objIE.Visible = True
        objIE.Navigate2 strURL(1)
        For i = 2 To 7
            objIE.Navigate2 strURL(i), 2048
        Next i
        Set objIE = CreateObject("InternetExplorer.Application")
        objIE.Visible = True
        objIE.Navigate2 strURL(8)
        For i = 9 To 14
            objIE.Navigate2 strURL(i), 2048
        Next i    
        Set objIE = Nothing
    End Sub
    Also, I just tried this on another machine at my work. I opened Internet Explorer and checked the 'Enable Protected Mode' checkbox, then closed/opened Internet Explorer and checked again - the box still had a check mark in it. When I tried running the macro, it still only opened a couple tabs in each window. From one of those tabs, I checked the security settings and found that the 'Enable Protected Mode' checkbox was not checked. While still in the security settings, I enabled it again, then closed all IE windows. The next time I ran the macro, it worked and has worked since.

    ~mp
    Last edited by Aussiebear; 03-01-2025 at 01:05 PM. Reason: Adjusted code tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •