mogseyoboyle
New Member
- Joined
- Oct 8, 2014
- Messages
- 1
Hi Guys
I am new to web controls in VBA and I can't figure this out.
I have a webbrowser control on a spreadsheet, and I am trying to login to a website using VBA. When I run the code I get a runtime error 91 message (where hightlighted).
I have figured a workaround if I can read in the page source, but I can't figure that out either yet.
Sorry if I haven't provided enough information, I am new to this.
I am using Office 2010 Pro Plus with Win 7
Any help would be most appreciated.
Thanks in advance
Mogsey
I am new to web controls in VBA and I can't figure this out.
I have a webbrowser control on a spreadsheet, and I am trying to login to a website using VBA. When I run the code I get a runtime error 91 message (where hightlighted).
Code:
Sub logIn(webBr As webBrowser, user As String, pass As String, URL As String)
With webBr
.Navigate URL
.Visible = True
Do While .Busy: DoEvents: Loop
Do While .ReadyState <> 4: DoEvents: Loop
With .Document
[highlight].all("user").Value = user [/highlight]
.all("pass").Value = pass
'.website.Value = "stw"
.submit.Click
End With
Do While .Busy: DoEvents: Loop
Do While .ReadyState <> 4: DoEvents: Loop
End With
End Sub
I have figured a workaround if I can read in the page source, but I can't figure that out either yet.
Sorry if I haven't provided enough information, I am new to this.
I am using Office 2010 Pro Plus with Win 7
Any help would be most appreciated.
Thanks in advance
Mogsey