Filling a form on a website with information from excel

Posted on 2003-03-15
Medium Priority
Last Modified: 2010-05-03

I hope to be write a program to fill a form on the internet with information from an excel spreadsheet. For example, there is a website where u have a personal account. You can access the account manually to input the information in the excel spreadsheet into the various fields of a form. I would like to find out how can i go about doing this automatically. I would really appreciate it if someone can provide me with some directions on how i can go about doing this.

Question by:Charlemagne_
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3

Expert Comment

ID: 8141835
'Make a reference to Microsoft Internet controls

Dim WithEvents IE As InternetExplorer
Private Sub Form_Load()
Set IE = New InternetExplorer
With IE
     .Navigate "www.hotmail.com" ' The URL
     .Visible = True
End With
End Sub
Private Sub IE_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If (pDisp Is IE) Then
 'Replace with appropriate text
    If InStr(1, URL, "passport.com/cgi-bin/login", vbTextCompare) Then
            Dim inp As Object
            Set inp = IE.Document.All.Item("login")
            inp.Value = "username"  'replace with your id
            Set inp = IE.Document.All.Item("passwd")
            inp.Value = "password"  'replace with your password
            Set inp = IE.Document.All.Item("enter")
     End If
End If
End Sub


Author Comment

ID: 8142753
Is there any website where i can find more information on it?

What happens if i wish to follow through a link? on the site that can only be access through clicking... any ideas?


Author Comment

ID: 8146322
I tried the code you posted... but it doesnt seem to work... i can open the url, but i am not able to proceed with entering my information. Can you help me out with this? thanks
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 8146519
Each Web Page is different. Look at the codesource of your url and search for "input type" to determine the names of the controls you want to fill.
Example :
<input type="password" name="passwd" maxlength="16" class="PPRField" size="25" tabindex="2" autocomplete="OFF">

The name of this control is "passwd" and it is an array.
So I think you would have to modify the code like this:

Set inp = IE.Document.All.Item("passwd")(2)
inp.Value = "mypassword"  'replace with your password

Author Comment

ID: 8272812
Sorry for the late reply... but i was wondering if there is anywhere i can read up on the IE object library?

Accepted Solution

DocM earned 200 total points
ID: 8273944

Author Comment

ID: 8338199
Hi DocM,

I tried the code u posted. I placed the form load in a module, the IE_DocumentComplete and the withevents declaration in a class module. I have also made the reference to the internet controls.

However, the code does not run.... do u think u can help me out?
Many thanks!

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question