Selecting a drop down in Internet Explorer

EVANWIT84

New Member
Joined
Sep 25, 2020
Messages
22
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
  3. Mobile
Hi All,

I'm trying to select a drop down for a client after logging into a website. For example, here are my steps:

1) I login to the site.
2) Select the client's URL.
3) Then I want to select the client name from the dropdown as noted in Range("B5").Value
4) I found code relating to the drop down from a separate thread (not an html expert but this is what I believe it to be.

If anyone looks, thank you in advance!

'.Document.getelementsbyname("options: xsp.Institutions, optionsText: 'entity_name', value: selectedInstitution").Item.Value = ClientName '''Newest Code if this breaks

Sub Login()

Const Url$ = " "

Dim UserName As String, Password As String, LoginData As Worksheet
Dim ClientName As String
Set LoginData = ThisWorkbook.Worksheets("Sheet1")
UserName = LoginData.Cells(1, "B").Value
Password = LoginData.Cells(2, "B").Value

Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")
ClientName = Range("B5").Value

With ie

.Navigate Url
ieBusy ie
.Visible = True

Dim oLogin As Object, oPassword As Object, oWBI As Object
Set oLogin = .Document.getelementsbyname("username")(0)
Set oPassword = .Document.getelementsbyname("password")(0)

oLogin.Value = UserName
oPassword.Value = Password
.Document.Forms(0).submit

'''''Select WBI or WII Website
If Range("B4").Value = "WBI" Then
ieBusy ie
ie.Navigate (") 'Goes to WBI
Else
ie.Navigate (") ' Goes to WII
End If

'.Document.getelementsbyname("options: xsp.Institutions, optionsText: 'entity_name', value: selectedInstitution").Item.Value = ClientName '''Newest Code if this breaks

End With

End Sub
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,223,912
Messages
6,175,340
Members
452,638
Latest member
Oluwabukunmi

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