VBA open Web page in new tab with Auto login

gmmdinesh

New Member
Joined
Sep 16, 2017
Messages
8
Hi Everyone

I have a couple of code for Auto login web pages and it all should be open in new Tab not New IE Window..
In this code i got Object error .. can any one help me to solve this.

Code:
Sub ssss()  
  Dim IE As Object
    With CreateObject("Shell.Application").Windows
        If .Count > 0 Then
          Set IE = .Item(0)
    Else
            Set IE = CreateObject("InternetExplorer.Application")
      IE.Visible = True
    End If
  Do Until Not IE.busy And IE.readyState = 4
        DoEvents
    Loop
    With IE
    .Navigate "https://mail.google.com" ' for Example
  .Document.getElementById("userNameInput").Value = Sheets("Portal").Range("C79").Value
    .Document.getElementById("passwordInput").Value = Sheets("Portal").Range("B20").Value
    .Document.getElementById("submitButton").Click
  


    End With




    Do Until Not IE.busy And IE.readyState = 4
        DoEvents
    Loop
    Set IE = Nothing
  
  End With
  
End Sub
Thanks in Advance.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Specify the flags argument with the Navigate method, like this:
Code:
Sub Test()
    Dim IE As Object, URL1 As String, URL2 As String, URL3 As String
    
    URL1 = "http://www.url1.com"
    URL2 = "http://www.url2.com"
    URL3 = "http://www.url3.com"
    Set IE = CreateObject("InternetExplorer.Application")
    With IE
        .Visible = True        
        .Navigate URL1, 0
        While .Busy Or .ReadyState <> 4: DoEvents: Wend
        .Navigate URL2, 2048&
        .Navigate URL3, 2048&
    End With
    
End Sub
2048 is the value of navOpenInNewTab- see https://msdn.microsoft.com/en-us/library/dd565688(v=vs.85).aspx. Note that Busy and ReadyState only apply to the first Navigate.
 
Upvote 0
Hi John
Thanks for your reply....
Your code only open web pages...but i want it'll be open and login automatically, then open another page on new tab and login automatically.....



Thanks
 
Upvote 0
My code just shows the basics for opening a new IE tab. You'll have to incorporate it into your code, which is specific to your sites.
 
Upvote 0
Hi John
Sorry for delay.

I have incorporate my code with your code, it's working.but the problem is it's login only First URL....for Next URL getting
Object Not found
Error....



Thanks
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,742
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top