IE Automation- filling in fields

zsault

New Member
Joined
Sep 17, 2015
Messages
1
Hello,

I'm trying to fill in fields on a website with excel and am having some issues. Ideally I would like to have the value taken from Cell(1,1). I have been able to automate the login process but that pages code is far more simple. I'm able to get to the page where information needs to be filled in. Love any ideas.

the code I'm using is this:
Private Sub IE_Autiomation()
Dim i As Long
Dim IE As Object
Dim objElement As Object
Dim objCollection As Object

' Create InternetExplorer Object
Set IE = CreateObject("InternetExplorer.Application")

IE.Visible = True

' Send the form data To URL As POST binary request
IE.Navigate "https://compliancelink.xxxxxxxxxxxxxx"

' Statusbar
Application.StatusBar = "Loading. Please wait..."




Application.StatusBar = "Search form submission. Please wait..."

Set objCollection = IE.document.getElementsByID("input")

IE.document.getElementById("thisCustData[0]").Value = "1"

Set IE = Nothing
Set objElement = Nothing
Set objCollection = Nothing

Application.StatusBar = ""
End Sub

The html provided from the site is:

- <td class="formLabel">


-Reference Number :
-<input type="hidden" name="thisCustData[0].fieldName" value="Reference Number">
-</td>
-<td class="formField">


- <input type="text" name="thisCustData[0].fieldValue" maxlength="50" size="50" value="">
 
Last edited:

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hello, can you post the actual HTML rather than what it looks like? Or is it not that bit you need help with?

Code:
Refno = Worksheets("Sheet1").Cells(1, 1).Value
 
 IE.document.getElementById("thisCustData[0]").Value = Refno
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,873
Members
449,056
Latest member
ruhulaminappu

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