Help needed with VBA code to filling a webform

Trainferry

New Member
Joined
Feb 6, 2018
Messages
2
Hello all,

I would like to create a code in VBA to complete some fields in a webform. Due to privacy-matters I can't copy the whole code of the form. However I can sent the part, where I'm stuck. To complete the webform it appaers I should note something like this in VBA.

<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; white-space: inherit;">IE.document.getelementsbyID("ABCDEF").Value = "XYZ"</code>In the source code it seems the elementID would be "Agent_name". However when submitting excel, the webform does not take over the value.

This is the source code:

<tr id="Agent_Name"><td class="FieldLabel"><label class="EditingFormLabel" id="p_lt_ctl03_pageplaceholder_p_lt_ctl00_On_lineForm_viewBiz_Agent_Name_lb" for="p_lt_ctl03_pageplaceholder_p_lt_ctl00_On_lineForm_viewBiz_Agent_Name_txtText">Agent name:</label></td><td class="EditingFormValueCell"><div class="EditingFormControlNestedControl editing-form-control-nested-control" id="p_lt_ctl03_pageplaceholder_p_lt_ctl00_On_lineForm_viewBiz_ncpagent_name">
<input name="p$lt$ctl03$pageplaceholder$p$lt$ctl00$On_lineForm$viewBiz$Agent_Name$txtText" class="form-control" id="p_lt_ctl03_pageplaceholder_p_lt_ctl00_On_lineForm_viewBiz_Agent_Name_txtText" type="text" maxlength="500">

</div></td></tr>

I hope someone can help me with this.

Many thanks in advance!
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
I noticed the code has been changed to a field, so here a copy of the code again:

input name="p$lt$ctl03$pageplaceholder$p$lt$ctl00$On_lineForm$viewBiz$Agent_Name$txtText" class="form-control" id="p_lt_ctl03_pageplaceholder_p_lt_ctl00_On_lineForm_viewBiz_Agent_Name_txtText" type="text" maxlength="500"
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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