Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub Van()
- Dim IE As Object
- Dim IE2 As Object
- Set IE = CreateObject("InternetExplorer.Application")
- 'Set IE2 = CreateObject("InternetExplorer.Application")
- IE.navigate ("https://secure.apia.com.au/NASApp/apia/CRQuoteServlet")
- IE.Visible = True
- Do
- DoEvents
- Loop Until IE.readystate = 4
- Set d = IE.document
- d.GetElementbyid("over50_Y").Click
- d.GetElementbyid("retired_Y").Click
- d.GetElementbyid("coverType_COM").Click
- d.GetElementbyid("principalDriver").Value = 55
- d.GetElementbyid("select_caravan_model").Click
- Application.Wait (Now + TimeValue("00:00:03"))
- Set IE2 = GetIE("https://secure.apia.com.au/NASApp/apia/CRQuoteServlet? pageAction=openModelSelectionWindow¤tSequenceNumber=")
- IE2.document.getElementsByTagName("select")(0).Value = "JAY"
- 'Also tried the line below
- 'IE2.document.GetElementsbyname("caravanMake")(0).SelectedIndex = 83
- End Sub
- Function GetIE(sAddress As String) As Object
- Dim objShell As Object, objShellWindows As Object, o As Object
- Dim retVal As Object, sURL As String
- Set retVal = Nothing
- Set objShell = CreateObject("Shell.Application")
- Set objShellWindows = objShell.Windows
- 'see if IE is already open
- For Each o In objShellWindows
- sURL = ""
- On Error Resume Next
- sURL = o.LocationURL
- On Error GoTo 0
- If sURL <> "" Then
- 'MsgBox sURL
- If sURL = sAddress Then
- Set retVal = o
- Exit For
- End If
- End If
- Next o
- Set GetIE = retVal
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement