Problem with web inputs

JerryGiese

Active Member
Joined
Jun 27, 2005
Messages
323
I am using VBA to open internet explorer, login, and enter a tracking number. The page where I enter the tracking number is:

http://www.hmm21.com/hmm/ebiz/track_trace/main_new.jsp

The problem happens when I try to enter the bill of lading number into the field. I tried this line of code:

Code:
ieobject.Document.All("numbers").Value = "Bill of lading goes here"

But then I just get an error as if that control doesn't exist. Can anyone help?
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Jerry

This just isn't an Excel/VBA problem, it's probably more connected to how the website/page is designed and it's HTML source code.

In fact when I look at the HTML code I lost count of the number of times 'numbers' appeared.:eek:
 
Upvote 0
Because the input fields don't have unique identifiers, you'll need to traverse the document tree to find the correct element.

In javascript, the first B/L field can be found like this:
Code:
document.getElementById('blfield1').getElementsByTagName('input')[0].value = 'Bill of Lading Goes Here'

Which takes the element by id 'blfield1' and find the first <INPUT> element. This would be pretty straigthforward to translate into VBA.
 
Upvote 0

Forum statistics

Threads
1,216,057
Messages
6,128,524
Members
449,456
Latest member
SammMcCandless

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