Here is the rest of the code for the first. Getting the second code in a minute. It's kinda sloppy but I've had to make do with a semi-automatic version that required some manual input. My client wants it fully automated though!
Sub RunModel()
Application.DisplayAlerts = False
Dim IE As Object
Dim LogIn As Variant
Dim ProcessComplete As Boolean
Set IE = CreateObject("InternetExplorer.Application") ' Open Office
'LogIn = MsgBox("Did you log into Skynet with Internet Explorer?", vbYesNo)
'Date Stuff
'------------------------Arrival Data-----------------
'Go to this Web Page!
Dim i As Integer
i = 2
Dim Ticker As String
For i = 2 To 429
IE.Navigate "http://douglasne.mapping-online.com/DouglasCoNe/static/valuation.jsp"
Do
If IE.ReadyState = 4 Then
IE.Visible = True
Exit Do
Else
DoEvents
End If
Loop
On Error Resume Next
Dim j As Integer
Set FormBar = IE.Document.Forms(0)
' If FormBar Is Nothing Then
' Exit Sub
' End If
Dim Dir As String
Dim Street As String
Dim Ave As String
Number = Cells(i, 1).Value
If Cells(i, 2).Value = "N" Or Cells(i, 2).Value = "S" Or Cells(i, 2).Value = "E" Or Cells(i, 2).Value = "W" Then
Dir = Cells(i, 2).Value
Street = Cells(i, 3).Value
Ave = Cells(i, 4).Value
Else
Dir = ""
Street = Cells(i, 2).Value
Ave = Cells(i, 3).Value
End If
Select Case Ave
Case "Street"
Ave = "ST "
Case "Avenue"
Ave = "AV"
Case "Drive"
Ave = "DR"
Case "Circle"
Ave = "CR"
Case "Boulevard"
Ave = "BLVD"
Case Else
Ave = ""
End Select
End If
With FormBar
FormBar(2).Value = Number
FormBar(3).Value = Dir
FormBar(4).Value = Street
FormBar(5).Value = Ave
FormBar.submit
On Error GoTo 0
Cells(i, 7) = IE.Document.getElementbyId("results").Cells(5).innertext
On Error GoTo 0
Next i
End Sub
Edit: I'm super sorry but the select case part that defined Ave is missing in some code somewhere. Trust me, there is a definition for it. The variables themselves are fine (at least they are defined) but they won't input into the forms. I know my code is an absolute mess but I have been toying with it for hours and I just cannot get these dumb forms to accept ANYTHING!
Edit #2: Found the avenue piece. I will update with code 2 in a minute.
Bookmarks