Login To Hotmail New tab Not new Window

Jaye7

Well-known Member
Joined
Jul 7, 2010
Messages
1,060
I found the following script on Google to login to hotmail and it works perfectly.

The only thing is, I would like to open Hotmail in a new tab NOT in a new window, can anyone help with this.


Code:
Sub IE_Login_Hotmail()
 
Dim objIE As InternetExplorer
 
Set objIE = New InternetExplorer
 
objIE.Navigate "[URL="http://www.hotmail.com/"]http://www.hotmail.com"[/URL]
objIE.Visible = True
 
'Loop unitl ie page is fully loaded
Do Until objIE.ReadyState = READYSTATE_COMPLETE
Loop
 
On Error Resume Next
objIE.Document.getElementById("i0116").Value = "abc@hotmail.com" 'username
objIE.Document.getElementById("i0118").Value = "abc" 'password
 
objIE.Document.getElementById("idSIButton9").Click
 
Set objIE = Nothing
 
End Sub
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
I got around this using VK keys, but if someone has a better solution then it would be appreciated.

Not perfect as if the tab etc... take too long to open then it will fall over.

Code:
Sub Login_To_Hotmail()
'open new tab and login to hotmail
ActivateWindow ("Internet Explorer")
 
    Sleep 2000
'new internet explorer tab
     KeyPlusKey 17, 84 'ctrl t
     Sleep 5000
 
'type in web address
    'www.hotmail.com
   Key 87
   Key 87
   Key 87
   Key 110
   Key 72
   Key 79
   Key 84
   Key 77
   Key 65
   Key 73
   Key 76
   Key 110
   Key 67
   Key 79
   Key 77
   Sleep 1000
'hit enter to open url
   Key 13 ' enter key
    Sleep 2000
 
Key 9 ' tab key
Sleep 1000
'my password keys here
Key 'whatever
Key 'whatever
'etc...
'etc...
Sleep 1000
'hit the enter key for final login process
Key 13
 
    End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,330
Messages
6,124,310
Members
449,152
Latest member
PressEscape

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