Hi all,
so what I am looking for is to be able to run something like a webquery but for the currently open web page as I have written a code (below) to login into a particular website but when using the traditional querytables command it is unable to connect to the site because the site wont allow access without login... So ultimately I need the data to be pulled from the open IE window.
Thanks for any help,Code:Sub IE_login() Dim ie As InternetExplorer Dim C Dim ULogin As Boolean, ieForm Dim MyPass As String, MyLogin As String Dim mypost As String redo: MyLogin = Range("a1") MyPass = Range("a2") Set ie = New InternetExplorer ie.Visible = True ie.Navigate "https://www.cmcmarketsstockbroking.com.au/logon.aspx" 'Loop until ie page is fully loaded Do Until ie.ReadyState = READYSTATE_COMPLETE Loop 'Look for password Form by finding test "Password" For Each ieForm In ie.Document.forms If InStr(ieForm.innertext, "Password") <> 0 Then ULogin = True 'enter details ieForm(0).Value = MyLogin ieForm(3).Value = MyPass 'login ieForm.submit GoTo datadl Exit For End If Next datadl: ie.Navigate "https://www.cmcmarketsstockbroking.com.au/net/ui/Research/Research.aspx?asxcode=" & Range("a4") & "&view=historical" Do Until ie.ReadyState = READYSTATE_COMPLETE Loop End Sub
Ash.




Reply With Quote
