Hi Graham,
You will need the property ID of the form elements on the webpage,
which you can generally get by viewing Page Source. The following code
is something I use to look up Postal Codes from an Excel addressbook.
Sub PostalLookup()
Dim ie As Object
Dim Rng As String
Rng = ActiveCell.Value
' Prepare to open the web page
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.navigate "
http://www.canadapost.ca/Personal/Tools/Pcl/
Range.aspx"
' Loop until the page is fully loaded
10 Do Until Not .Busy
DoEvents
Loop
' Make the desired selections on the web page and click the submit
Button
On Error GoTo 10
Set ipf = ie.document.all.Item("postal_code") 'Selects the
field to enter in the postal code
ipf.Value = Rng 'Enters the postal code from the
ActiveCell into the form
Set ipf = ie.document.all.Item
("ctl00_ctl00_ctl00_ctl00_SegmentContent_MainContent_PersonalContent_PclContent_Submit")
'Selects the submit button
ipf.Click
Do Until Not .Busy
DoEvents
Loop
End With
End Sub
HTH,
Steven