Login Automatically into Social Media Networks in IE using Excel
These days’ people spend too much time in Social Media Networks like Facebook, Twitter, and Google+.
We tend to Login and Logout so frequently into these accounts. Sometimes we get tired mentally, typing these Login IDs and Passwords either because it is too lengthy or we logout/log in often. We can bypass that tiny boring moment ,of re-typing the login credentials again and again, by automating the steps with the help of Excel Macro.
Login Form & Common Fields
When we type the URL of FB, Twitter or any kind of Webpage that has a Login Form, It will have these fields.
- Login ID or Email ID or Mobile Number
- Submit button
Note: Sometimes there is a CAPTCHA or a text box asking answer for a security question in Login Forms. This is used to stop spamming. If any Login form has this security option enabled, then we will not be able to use the techniques explained in this article.
We type values in each of these fields manually and click on the submit button. Once we submit, the credentials are transferred to the corresponding server for validation.
Auto Fill Form and Click Submit Button
With the below code snippet we will be able to fill a Login form in Facebook. The same code can be used to auto fill Twitter, Google+ or any HTML form. All you need to do is to analyze the HTML Source code before automating the login process.
Lets see how to do this for Facebook and then discuss more on other forms.
Copy this code, Paste it in Excel VB Editor and Execute by Pressing F5.
Visual Basic12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758Private Sub Facebook_Login_Automate()'Declare Variables used in CodeDim InetApp As ObjectDim TagsArray As ObjectDim TagField As Object'Create InternetExplorer Object and Launch AppSet InetApp = CreateObject("InternetExplorer.Application")InetApp.Visible = True'Navigate to FacebookInetApp.Navigate "http://www.facebook.com/"'Internet Explorer Load Time WaitDo While InetApp.BusyApplication.StatusBar = "Application Loading. Please Wait..."Application.Wait DateAdd("s", 1, Now)LoopApplication.StatusBar = ""'HTML code is obtained from URL.'Search for tag <input> and store it details in a object.Set TagsArray = InetApp.document.getElementsByTagName("input")idx = 0'Search Fields Corresponding to 'Login id', 'Password' and 'Submit' button.While idx < TagsArray.LengthIf TagsArray(idx).Name = "email" ThenTagsArray(idx).Value = "FB_Login_Mail_ID@mail.com"ElseIf TagsArray(idx).Name = "pass" ThenTagsArray(idx).Value = "FB_Login_Password"End IfIf TagsArray(idx).Type = "submit" And _TagsArray(idx).Name = "" ThenSet TagField = TagsArray(idx)End IfEnd Ifidx = idx + 1Wend'Click Submit ButtonTagField.Click'Login Wait TimeDo While InetApp.BusyApplication.StatusBar = "Login in Progess. Please Wait..."Application.Wait DateAdd("s", 1, Now)LoopApplication.StatusBar = ""InetApp.Visible = True'Clear Object DataSet InetApp = NothingSet TagField = NothingSet TagsArray = NothingEnd Sub
This code actually gets the HTML source for a form. Then search for the Login and Password text fields and substitute a value for them. Once this is done, it auto click the ‘Submit’ button.
All you need to do is to just run the macro with a button click and wait for the code to throw your Facebook wall.
To use the same technique with Twitter or Google+, search or inspect the Tag and Field names used in Login Form and substitute them in the above code.
The code will have password stored in it. So, protect the VBA project with a strong password and also store the Excel document in a secure way. Else, you Social Media Login Credentials will be compromised.
Previous Post: WhatsApp on PC using Windows Android Emulator for PC
Next Post: Block Candy Crush & Other Game Requests in Facebook
Login to Facebook, Twitter, Google+ in IE from Excel