Originally Posted by
Dreamboat
Anybody?
Hello,
I thought I had answered this at some point, but I can't find it...
Well, I never really have liked hyperlinks, but I do like VB. So, you want to control a secure website in an instance of an Internet Explorer App? You can do so with a new instance, you never need to see it actually. Below is an example of logging into this website, and shows how to pass values and submit them to the site. Simply change your Username and Password:
Public Declare Function ShowWindow& Lib "user32" ( _
ByVal hwnd As Long, ByVal nCmdShow As Long)
Private Sub Yadda()
Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")
On Error GoTo 1
With ie
.navigate "http://www.vbaexpress.com/forum/index.php"
Do While .busy: DoEvents: Loop
Do While .ReadyState <> 4: DoEvents: Loop
With .Document.Forms(1)
.vb_login_username.Value = "UserName"
.vb_login_password.Value = "Password"
.submit
End With
Do While .busy: DoEvents: Loop
Do While .ReadyState <> 4: DoEvents: Loop
Do While Not CBool(InStrB(1, .Document.URL, _
"index.php"))
DoEvents
Loop
.Visible = True
Call ShowWindow(.hwnd, 3)
End With
Set ie = Nothing
Exit Sub
1: MsgBox Err.Description
ie.Quit
Set ie = Nothing
End Sub
From here you can scrape a screen, etc... Sorry about the delayed response.
Edit: I switched to the code tags, the spacing didn't look right to me with the VBA tags, still doesn't look right, appears to have extra tabs (I.E. 6.0), but it copies and pastes fine.