I've been trying to create logins for my work processes. Some websites work.
This link is ALMOST an answer except ieObj is not defined. vba automation in Internet Explorer - clicking different buttons on successive webpages not working?
Here's what I have. Pared down. Italics are variable references. Normally this works great. The button on this website Doesn't have a "name" though. Just a Class, Onclick, and Title (but the title is "" null). I've tried .getelementbytagName(Button), .getelementbyclassname("ButtonThemeA") and a slew of other things. It always errors at the button click section.
How do I reference this button and click it?
I get a Run-Time Error '438'; Object doesn't support this property or method.
Sub Login1()
Dim ieApp As InternetExplorer
Dim ieDoc As Object
Dim LoginVal As String
Dim PassVal As String
Dim ieForm As Object
Dim ieObj As Object
'create a new instance of ie
Set ieApp = New InternetExplorer
'you don’t need this, but it’s good for debugging
ieApp.Visible = True
'Login Screen
ieApp.Navigate "*webpage to login*"
Do While ieApp.Busy: DoEvents: Loop
Do Until ieApp.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop
'Get the login values
LoginVal = Workbooks("Macrobook").Sheets("Login").Cells(2, 3).Value
PassVal = Workbooks("Macrobook").Sheets("Login").Cells(2, 4).Value
Set ieDoc = ieApp.Document
'fill in the login form
With ieDoc
.getElementById("usr_name").Value = LoginVal
.getElementById("usr_password").Value = PassVal
.getElementbyTagName(button).Click
End With
Do While ieApp.Busy: DoEvents: Loop
Do Until ieApp.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop
'To acct list screen
ieApp.Navigate "*Acct list URL - Not important for this question*"
Do While ieApp.Busy: DoEvents: Loop
Do Until ieApp.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop
'And it goes on from here.
End Sub