Automatically login to Gmail from excel using VBA
Page 1 of 1 • Share •
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 thisThank 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

» How do I open a particular email from Gmail using Selenium IDE?
» DataDriven from Excel in C# with NUnit
» How do I make the login popup show an Image, instead of it's bland colors
» Sharepoint forgets login and doesn't react on clicks on in-page-links
» HOW TO RUN SERVER AUTOMATICALLY IN ECLIPSE USING SELENIUM RC
» DataDriven from Excel in C# with NUnit
» How do I make the login popup show an Image, instead of it's bland colors
» Sharepoint forgets login and doesn't react on clicks on in-page-links
» HOW TO RUN SERVER AUTOMATICALLY IN ECLIPSE USING SELENIUM RC
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
» Microsoft Office 2013 full version free download
» Automatically login to Gmail from excel using VBA
» Internet download manager lifetime crack download
» Create In-cell bar charts in Excel
» Concatenate several cells with a comma
» New users please read this.