Automatically login to Gmail from excel using VBA
2 posters
Page 1 of 1
Automatically login to Gmail from excel using VBA
Hello everyone,
I would like to share a topic which has been a question mark for many excel users - how to login to gmail automatically from excel using VBA and the solution is here..
This VBA code is used to login to gmail from Internet explorer.
In my next post i will be posting how to use chrome or firefox for this and it requires installation of a small software, The reason behind why software is to be installed for chrome & firefox and not required for Internet explorer is - IE and Excel are microsoft softwares and so they have inbuilt controls to each other and contrary in case of firefox and chrome.
Here is the VBA code i used
We can alter this code to make automation to other sites, Please check the attached file for more info.
Regards,
Ranjith
I would like to share a topic which has been a question mark for many excel users - how to login to gmail automatically from excel using VBA and the solution is here..
This VBA code is used to login to gmail from Internet explorer.
In my next post i will be posting how to use chrome or firefox for this and it requires installation of a small software, The reason behind why software is to be installed for chrome & firefox and not required for Internet explorer is - IE and Excel are microsoft softwares and so they have inbuilt controls to each other and contrary in case of firefox and chrome.
Here is the VBA code i used
- Code:
Dim HTMLDoc As HTMLDocument
Dim MyBrowser As InternetExplorer
Sub AutoLogin()
Dim MyHTML_Element As IHTMLElement
Dim MyURL As String
On Error GoTo Err_Clear
MyURL = "http://gmail.com"
Set MyBrowser = New InternetExplorer
MyBrowser.Silent = True
MyBrowser.navigate MyURL
MyBrowser.Visible = True
Do
Loop Until MyBrowser.readyState = READYSTATE_COMPLETE
Set HTMLDoc = MyBrowser.document
HTMLDoc.all.Email.Value = Sheets(1).Range("B9").Value
HTMLDoc.all.Passwd.Value = Sheets(1).Range("B11").Value
For Each MyHTML_Element In HTMLDoc.getElementsByTagName("input")
If MyHTML_Element.Type = "submit" Then MyHTML_Element.Click: Exit For
Next
Err_Clear:
If Err <> 0 Then
Err.Clear
Resume Next
End If
End Sub
We can alter this code to make automation to other sites, Please check the attached file for more info.
Regards,
Ranjith
- Attachments
ranjithkumar8352- Posts : 5
Join date : 2014-05-14
Thanks a lot
Thanks a lot ranjith, I've been searching for this Thank you and waiting to see how it works in chrome
David_cool- Guest
Re: Automatically login to Gmail from excel using VBA
David_cool wrote:Thanks a lot ranjith, I've been searching for this Thank you and waiting to see how it works in chrome
With pleasure David
ranjithkumar8352- Posts : 5
Join date : 2014-05-14
Re: Automatically login to Gmail from excel using VBA
Thanks ranjith,
this is useful for me....
please come out with more of this kind..
this is useful for me....
please come out with more of this kind..
shyam chegu- Posts : 1
Join date : 2014-05-17
Re: Automatically login to Gmail from excel using VBA
shyam chegu wrote:Thanks ranjith,
this is useful for me....
please come out with more of this kind..
With pleasure shyam
ranjithkumar8352- Posts : 5
Join date : 2014-05-14
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|
Wed May 21, 2014 8:04 pm by Admin
» Microsoft Office 2013 full version free download
Tue May 20, 2014 6:02 pm by Admin
» Automatically login to Gmail from excel using VBA
Sun May 18, 2014 1:41 pm by ranjithkumar8352
» Internet download manager lifetime crack download
Sun May 18, 2014 1:32 pm by Admin
» Create In-cell bar charts in Excel
Thu May 15, 2014 6:41 am by ranjithkumar8352
» Concatenate several cells with a comma
Wed May 14, 2014 6:00 pm by ranjithkumar8352
» New users please read this.
Tue May 13, 2014 11:16 pm by Admin