• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA for open multiple webpage in new tab (IE)

gmmdinesh

New Member
HI Everyone
I have a VBA Code to open and auto login a separate web pages (Nearly 10). i need to open all these macros with single click, so i have call all of these macros by button. the problem is this all are opening with new internet Explorer application.
What i need is when i click the button IE should be opened as new and rest of the sites should be opened in new tab (but same IE).

Is anyone know how to open multiple pages in new tab.
Sample codes
Code:
Sub AutoLogin_gmail()
    Set ie = CreateObject("InternetExplorer.Application")
    my_url = "www.google.com"

    With ie
        .Visible = True
        .Navigate my_url
        .Top = 50
        .Left = 530
        .Height = 400
        .Width = 400

    Do Until Not ie.Busy And ie.readyState = 4
        DoEvents
    Loop

    End With

' Input the userid and password
    ie.Document.getElementById("uid").Value = "testID"
    ie.Document.getElementById("password").Value = "testPW"

    ie.Document.getElementById("enter").Click

    Do Until Not ie.Busy And ie.readyState = 4
        DoEvents
    Loop
End Sub
Code:
Sub Autologin_yahoo()
    Set ie = CreateObject("InternetExplorer.Application")
    my_url = "www.mail.yahoo.com"

    With ie
        .Visible = True
        .Navigate my_url
        .Top = 50
        .Left = 530
        .Height = 400
        .Width = 400

    Do Until Not ie.Busy And ie.readyState = 4
        DoEvents
    Loop

    End With
    ie.Document.getElementById("uid").Value = "testID"
    ie.Document.getElementById("password").Value = "testPW"
    ie.Document.getElementById("enter").Click

    Do Until Not ie.Busy And ie.readyState = 4
        DoEvents
    Loop
End Sub
Thanks in advance.
 

gmmdinesh

New Member
Actually i don't get solution there..in vbforum expert trying to solve this ..and provide some codes all are working for him...but not working with me...so that i have post here for the solution....
 

Guzman

New Member
What's the problem with cross posting?
As long as he shares what he finds out in every forum he posted, I think it's ok. I also do it.
The idea is to share knowledge, not to restrict forum's activity.

THIS ARE FORUM's RULES ABOUT CROSSPOSTING:
  • Cross-Posting. Generally, it is considered poor practice to cross post. That is to post the same question on several forums in the hope of getting a response quicker.
  • If you do cross-post, please put that in your post.
  • Also if you have cross-posted and get an answer elsewhere, have the courtesy of posting the answer here so other readers can learn from the answer also, as well as stopping people wasting their time on your answered question.
 
Last edited:

gmmdinesh

New Member
I got the same issue, 1st link was working perfectly, second one not login.
Code:
Sub FillinternetForm()
    Dim IE As Object
    Set IE = CreateObject("Internetexplorer.Application")
  IE.Navigate "https://mail.google.com"
    IE.Visible = True
    While IE.Busy
        DoEvents 'wait until IE is done loading page.
    Wend
    IE.Navigate "https://mail.google.com", CLng(2048)
      IE.document.getElementById("userNameInput").Value = "Fast Sub"
    IE.document.getElementById("passwordInput").Value = "Fast slow Sub"
    IE.document.getElementById("submitButton").Click
    IE.Navigate "https://mail.google.com"
    IE.Visible = True
    While IE.Busy
        DoEvents 'wait until IE is done loading page.
    Wend
    IE.Navigate "https://mail.google.com", CLng(2048)
      IE.document.getElementById("userNameInput").Value = "Fast Sub"
    IE.document.getElementById("passwordInput").Value = "Fast slow Sub"
    IE.document.getElementById("submitButton").Click
    End Sub
 

Chihiro

Excel Ninja
What's the problem with cross posting?...
When OP does not follow the last two points. Many of us will ignore the thread until it's rectified. Rules are there for a reason. In this case, it's bit of gray zone.

However... I for one, would like to know the history of the issue and what methods/solution has been suggested or worked on in another forum. This would help me in not going down the same path that's been already tried and failed etc.

When post is identified as cross posting, or continuation of another thread/forum and lacks link. I tend to skip over it.
 
Top