Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Submitting an Internet form in IE

I'm a beginner at VB, but know way more than everyone I work with.
I've never tried to call another application with Excel before and am
trying to submit data from a workbook into a form on a web page.
Right now I'm trying to come up with the simplest proof of concept I
can get, so let's assume I'm logged in exactly to the page I need to
be at, all I want to demonstrate is the ability to copy data from the
Workbook to the various fields on the web page.

Anyone feeling like throwing me a bone here?

1) trying to take the value in A2 "account number" field from my excel
sheet and put it in the "account number" field in Explorer

2) tab to the next field in explorer

3) Repeat for 25 or so fields

Anyone have any canned script they might be willing to share?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Submitting an Internet form in IE

Try this code. You enter the Zip code and the data gets enetered into the US
government Zip code web page and finds the city.


Sub GetZipCodes()

ZIPCODE = InputBox("Enter 5 digit zipcode : ")

Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True

URL = "http://zip4.usps.com/zip4/citytown_zip.jsp"

'get web page
IE.Navigate2 URL
Do While IE.readyState < 4
DoEvents
Loop

Do While IE.busy = True
DoEvents
Loop
Set Form = IE.document.getElementsByTagname("Form")

Set zip5 = IE.document.getElementById("zip5")
zip5.Value = ZIPCODE

Form(0).Submit
Do While IE.busy = True
DoEvents
Loop

Set Table = IE.document.getElementsByTagname("Table")
If Table(0).Rows(0).innertext = "" Then
MsgBox ("Invalid Zip code")
Else
Location = Table(0).Rows(2).innertext
End If
IE.Quit
MsgBox ("Zip code = " & ZIPCODE & " City/State = " & Location)


End Sub



" wrote:

I'm a beginner at VB, but know way more than everyone I work with.
I've never tried to call another application with Excel before and am
trying to submit data from a workbook into a form on a web page.
Right now I'm trying to come up with the simplest proof of concept I
can get, so let's assume I'm logged in exactly to the page I need to
be at, all I want to demonstrate is the ability to copy data from the
Workbook to the various fields on the web page.

Anyone feeling like throwing me a bone here?

1) trying to take the value in A2 "account number" field from my excel
sheet and put it in the "account number" field in Explorer

2) tab to the next field in explorer

3) Repeat for 25 or so fields

Anyone have any canned script they might be willing to share?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Submitting An Excel Template Daniel Bunt Excel Discussion (Misc queries) 0 May 12th 07 02:12 AM
Submitting form variables to Excel sheet Nahka-Sakke Excel Programming 0 September 20th 06 07:47 PM
Generating numbers & submitting details from one sheet to another Meenakshi Sood Excel Worksheet Functions 0 February 9th 06 06:57 PM
Web Query - Submitting Data and Capturing Result Ben Excel Discussion (Misc queries) 0 October 6th 05 02:29 PM
Dowloading internet data to worksheet form a ".ccv" file Duane L Kibby Excel Worksheet Functions 0 April 24th 05 08:24 PM


All times are GMT +1. The time now is 08:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"