Automating an excel list to a web form repeatedly

Quentonbailey

New Member
Joined
Nov 20, 2015
Messages
1
Hi, I'm completely new to Vba, just starting playing around with it this week. My job is heavy with data entry and I'm trying to be a little more efficient. I have contact lists that live on excel spreadsheets that need to be transferred to web form and the only way of doing it is one at a time. I'm having 2 issues, the first is on the web form the name of the "email_address" element is not working and I'm constantly getting an error. And second, once I get past that, I have no idea how to get Vba to continuously repeat the process down a list.

What I have so far is below.


Sub FillInternetForm()
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
'create new instance of IE. use reference to return current open IE if
'you want to use open IE window. Easiest way I know of is via title bar.
IE.Navigate "http://online.outdoors.org/site/c.gsJMKZPGJrH/b.8729017/k.9BFB/NY_Contact_Form/apps/ka/ct/contactus.asp?c=gsJMKZPGJrH&b=8729017&en=7gLDKONrF6JMLYPuG5LJIUNEJhLGLWMGJhLOJWPEJqJ3E"
'go to web page listed inside quotes
IE.Visible = True


While IE.Busy
DoEvents 'wait until IE is done loading page.
Wend


myVar = IE.document.Title


IE.document.ALL("first_name").Value = ThisWorkbook.Sheets("sheet1").Range("a1")


Application.Wait Now + TimeValue("00:00:01")


IE.document.ALL("last_name").Value = ThisWorkbook.Sheets("sheet1").Range("b1")


Application.Wait Now + TimeValue("00:00:01")


IE.document.ALL("email_address").Value = ThisWorkbook.Sheets("sheet1").Range("c1")


Application.Wait Now + TimeValue("00:00:01")


IE.document.ALL("zip").Value = ThisWorkbook.Sheets("sheet1").Range("d1")


Application.Wait Now + TimeValue("00:00:01")


IE.document.ALL("SubmitButton").Click


While IE.Busy
DoEvents 'wait until IR is done loading page.
Wend


IE.Navigate "http://online.outdoors.org/site/c.gsJMKZPGJrH/b.8729017/k.9BFB/NY_Contact_Form/apps/ka/ct/contactus.asp?c=gsJMKZPGJrH&b=8729017&en=7gLDKONrF6JMLYPuG5LJIUNEJhLGLWMGJhLOJWPEJqJ3E"
'go to web page listed inside quotes
IE.Visible = True


While IE.Busy
DoEvents 'wait until IE is done loading page.
Wend


End Sub
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top