alexdkinguk
New Member
- Joined
- Oct 18, 2018
- Messages
- 3
Hi all, can anyone help with the below? I can't get it to repeat the code but I don't know why.
'START LOOP HERE
Do Until Sheets("Sheet1").Range("A4").Value = ""
Set mytextfield = IE.document.all.Item("txtJobNo")
mytextfield.Value = Sheets("Sheet1").Range("A4").Value
'Next
'Press submit button
IE.document.getElementById("btnSubmit").Click
Application.Wait (Now + TimeValue("0:00:02"))
'Click on Stage 3
IE.document.getElementById("Image3").Click
Application.Wait (Now + TimeValue("0:00:02"))
'Click edit details
IE.document.getElementById("Submit1").Click
Application.Wait (Now + TimeValue("0:00:02"))
'Copy and paste the date from the spreadsheet.
Set mydatefield = IE.document.all.Item("txtDateWorksCompleted")
mydatefield.Value = Sheets("Sheet1").Range("B4").Text
'Click Submit
IE.document.getElementById("Button3").Click
Application.Wait (Now + TimeValue("0:00:02"))
'Click Continue
Set Continue = IE.document.all.Item("btnSubmit1")
Continue.Click
'IE.document.getElementByName("btnSubmit1").Click
Application.Wait (Now + TimeValue("0:00:02"))
'Click Close
Set Continue = IE.document.all.Item("btnSubmit1")
Continue.Click
'Delete row (THIS BIT WORKS)
Range("A4:B4").Select
Selection.Delete Shift:=xlUp
'lOOP BACK
Loop
End Sub
'START LOOP HERE
Do Until Sheets("Sheet1").Range("A4").Value = ""
Set mytextfield = IE.document.all.Item("txtJobNo")
mytextfield.Value = Sheets("Sheet1").Range("A4").Value
'Next
'Press submit button
IE.document.getElementById("btnSubmit").Click
Application.Wait (Now + TimeValue("0:00:02"))
'Click on Stage 3
IE.document.getElementById("Image3").Click
Application.Wait (Now + TimeValue("0:00:02"))
'Click edit details
IE.document.getElementById("Submit1").Click
Application.Wait (Now + TimeValue("0:00:02"))
'Copy and paste the date from the spreadsheet.
Set mydatefield = IE.document.all.Item("txtDateWorksCompleted")
mydatefield.Value = Sheets("Sheet1").Range("B4").Text
'Click Submit
IE.document.getElementById("Button3").Click
Application.Wait (Now + TimeValue("0:00:02"))
'Click Continue
Set Continue = IE.document.all.Item("btnSubmit1")
Continue.Click
'IE.document.getElementByName("btnSubmit1").Click
Application.Wait (Now + TimeValue("0:00:02"))
'Click Close
Set Continue = IE.document.all.Item("btnSubmit1")
Continue.Click
'Delete row (THIS BIT WORKS)
Range("A4:B4").Select
Selection.Delete Shift:=xlUp
'lOOP BACK
Loop
End Sub