Opening Multiple IE Tabs via VBScript, IE11

Discussion in 'Scripting' started by Cripple.Zero, Oct 14, 2016.

  1. Cripple.Zero

    Cripple.Zero MDL Novice

    Jun 7, 2016
    #1 Cripple.Zero, Oct 14, 2016
    Last edited by a moderator: Apr 20, 2017
    I want to launch IE using multiple tabs via .VBS script. I am able to get the main (or home) tab plus one more tab to open with whatever websites I choose. However, once I start adding lines for a 3rd tab or more, I receive VB errors either "null" or "client disconnected" -type errors.

    Included is one of the codes I've been toying with:

    Const navOpenInBackgroundTab = &H1000
    site1 = ""
    site2 = ""
    Set oIE = CreateObject("InternetExplorer.Application")
    oIE.Visible = True
    oIE.Navigate2 site1
    oIE.Navigate2 site2,navOpenInBackgroundTab
    Set oIE = Nothing
    Any variation of the "site1" and/or "site2" lines, I receive no errors. Once I start adding lines for a "site3" or "site4" and so on, I receive errors.

    I've gathered some information on the codes from various websites:
    h t t p : // stackoverflow .com/questions/19763171/batch-file-to-set-homepage-in-all-browsers
    h t t p : // stackoverflow .com/questions/26099153/open-tabs-in-internet-explorer-with-cmd
    h t t p s : // www .experts-exchange .com/questions/24698182/VBS-Script-to-Specify-Default-Tab.html#answer25234362

    I just can't seem to get more than 2 tabs to open in IE11
  2. Cripple.Zero

    Cripple.Zero MDL Novice

    Jun 7, 2016
    <EDIT>I just realized I put in the example code internal websites for sites 1 & 2. Now, while this doesn't change the situation of not being able to open more than 2 tabs at a time, it will help in diagnosing the problem for others who don't have access to those internal sites. In summation, it doesn't matter what types of websites I put in for sites 1 & 2 (internal like intranet or external like google or yahoo), adding sites 3, 4, and so on beget scripting errors left and right.