select given value from dropdown list and click to add button

Ajinkya_1988

New Member
Joined
Mar 29, 2019
Messages
3
I can login on my website then then navigate to a web page where I need to select a value from a drop down box then need to click on add button. (using <code style="margin: 0px; padding: 1px 5px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: 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; box-sizing: inherit; background-color: rgb(239, 240, 241); white-space: pre-wrap; color: rgb(36, 39, 41);">vba</code>). select given value from dropdown list and click to add button. I am not able to do that i have tried but unable to do that.
my drop down list html code :
<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; box-sizing: inherit; white-space: inherit;"><select id="input_ifxlist_opts"><option value="43.66.18.70>11">SAL-EC-S1&gt;sp_wan</option>

<option value="43.72.38.250>11">SDT-EC-S1&gt;sp_wan</option>
<option value="43.95.88.9>3">SISC-CE2&gt;Gi0/2</option>
<option value="43.95.88.5>3">SISC-CE1&gt;Gi0/2</option>
<option value="43.88.32.237>11">SID-EC-S1&gt;sp_wan</option>
<option value="43.95.74.54>2">SOEM_PG-CE1V.virtela.net&gt;Gi0/0/1</option>
<option value="43.95.66.1>2">SAL-CE1&gt;Gi0/1</option>
<option value="43.76.42.10>2">SEK-CE1V&gt;Gi0/0</option>
<option value="43.95.94.5>2">SEV-CE2&gt;Gi0/1</option>
<option value="43.95.78.9>2">SI-CE2&gt;Gi0/1</option>
<option value="43.95.88.13>3">SID-CE1&gt;Gi0/1</option>
<option value="43.95.76.5>1">SOK-CE1&gt;Gi0/0</option>
<option value="43.95.86.9>37">SOMEA-CE1&gt;Gi0/1.102</option>
<option value="43.95.92.9>2">SPH-CE1&gt;Gi0/0/1</option>
<option value="43.95.70.2>2">STWN-CE1V&gt;Gi0/1</option>
<option value="43.95.74.2>3">SOEM_KL-CE3&gt;Gi0/1</option>
<option value="43.95.74.62>2">SOEM_KL-CE1V.virtela.net&gt;Gi0/0/1</option>
<option value="43.95.74.46>2">SOMAS-CE1V&gt;Gi0/0/1</option>
<option value="43.95.72.33>2">SDT-CE1.virtela.net&gt;Gi0/0/1</option>
<option value="43.95.72.45>2">SOTHAI-CE&gt;Gi0/0/1</option>
<option value="43.95.72.41>2">STT-CE1V.virtela.net&gt;Gi0/0/1</option>
<option value="43.95.72.37>2">STTB-CE1.virtela.net&gt;Gi0/0/1</option>
<option value="43.74.61.6>11">SOEM-PG-EC-S1&gt;sp_wan</option>
<option value="43.95.92.2>2">SPHWNS-CE&gt;Gi0/0/1</option>
<option value="43.95.65.1>4">GDC-CE1&gt;Gi0/2</option>
<option value="43.72.61.5>11">SOTHAI-EC-S1&gt;sp_wan</option>
<option value="146.215.74.110>3">IBP-CE1&gt;Gi0/1</option>
<option value="43.95.86.9>2">SOMEA-CE1&gt;Gi0/1</option>
<option value="43.95.88.5>2">SISC-CE1&gt;Gi0/1</option>
<option value="43.95.88.9>2">SISC-CE2&gt;Gi0/1</option>

my add button html code is :

<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; box-sizing: inherit; white-space: inherit;"><button type="button" *******="addToList(document.forms['queryform'].input_ifxlist,document.getElementById('input_ifxlist_opts'))">Add</button>

Sub login_page()


<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; box-sizing: inherit; white-space: inherit;">Dim ieApp As SHDocVw.InternetExplorer
Dim iedoc As MSHTML.HTMLDocument
'Dim ieApp As InternetExplorer
'Dim ieDoc As Object
'Dim ieTable As Object
'Dim clip As DataObject

Set ieApp = New SHDocVw.InternetExplorer

ieApp
.Visible = True

ieApp
.navigate "http:"
Do While ieApp.Busy: DoEvents: Loop
Do Until ieApp.readyState = READYSTATE_COMPLETE: DoEvents: Loop

Set iedoc = ieApp.document

'fill in the login form – View Source from your browser to get the control names
With iedoc.forms(0)
.user.Value = "id"
.Password.Value = "Pass"
.submit

End With

ieApp
.navigate "http:"
Do While ieApp.Busy: DoEvents: Loop

ieApp
.navigate "http:"
Do While ieApp.Busy: DoEvents: Loop

ieApp
.navigate "http:"
Do While ieApp.Busy: DoEvents: Loop


ieApp
.navigate "http:"
Do While ieApp.Busy: DoEvents: Loop

ieApp
.navigate "http:"
Do While ieApp.Busy: DoEvents: Loop

ieApp
.navigate "http:"
Do While ieApp.Busy: DoEvents: Loop

ieApp
.navigate "http:"
Do While ieApp.Busy: DoEvents: Loop

ieApp
.navigate "http:"
Do While ieApp.Busy: DoEvents: Loop

End Sub
</code>
</code></pre>
</code></pre>
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,224,820
Messages
6,181,161
Members
453,021
Latest member
Justyna P

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