Fill Web Form with User Form Data

How to fill web form with User Form data automatically with VBA. To log into a website we can create a similar user form and then fill the web form via the user form using VBA. Watch the video:

Watch this video on YouTube.

user form
Fill web form with user form data using VBA

Here’s the complete VBA code to automate the process of filling web forms using data of user forms via Excel VBA:

Private Sub CommandButton2_Click()

Url = “https://manage.mylimobiz.com/admin/login.asp”

Set ie = CreateObject(“internetexplorer.application”)
ie.Visible = True
ie.navigate Url

Dim HTMLDoc As HTMLDocument

Dim MyHTML_Element As IHTMLElement
Do
Loop Until ie.readyState = READYSTATE_COMPLETE

Set HTMLDoc = ie.document

HTMLDoc.all.companyid.Value = TextBox1.Text
HTMLDoc.all.UserName.Value = TextBox2.Text
HTMLDoc.all.Password.Value = TextBox3.Text

For Each MyHTML_Element In HTMLDoc.getElementsByTagName(“input”)
If MyHTML_Element.Type = “image” Then
MyHTML_Element.Click: Exit For
End If
Next

End Sub

Published by

Dinesh Kumar Takyar

Welcome to exceltrainingvideos.com! My aim is to help you learn MS Excel including VBA. I always felt that a good way to learn something was to find solutions to problems in that domain. That is why I share these Excel videos with you. Mostly these are questions asked during my corporate training sessions. I've been training individuals and companies in computers since 1991. I did my B. Sc. (Vordiplom), M. Sc. (Diplom) and Ph.D. (Dr. rer. nat.) from Hamburg, Germany. The best thing about solving some of my visitor's questions is that I also gain new insights. For more Excel VBA solutions you may like to visit my YouTube channel: http://youtube.com/familycomputerclub For a structured Excel VBA training course online you can visit: https://www.youtube.com/excelvbaonline

Leave a Reply

Your email address will not be published. Required fields are marked *