EVANWIT84
New Member
- Joined
- Sep 25, 2020
- Messages
- 22
- Office Version
- 365
- Platform
- Windows
- MacOS
- 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
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