The VBA code below sometimes takes more than twenty seconds to run, now a decision is made that if this code takes longer than 20 seconds then it should quit and move to the next code instead of rotating for 10 minutes on one code, for sure a timer is required, that is where it's getting interesting?
Any idea on how to insert a timer and quit after 20 sends will be highly recommended
Code:
Dim Request As Object
Dim stUrl As String
Dim Response As String
Dim requestBody As String
stUrl = "http://localhost:8080/XXXXXXXXXXXXXXXXXXXXXXXXX"
Set Request = CreateObject("MSXML2.XMLHTTP")
requestBody = strData
With Request
.Open "POST", stUrl, False
.setRequestHeader "Content-type", "application/json"
.Send requestBody
Response = .ResponseText
End With
If Request.Status = 200 Then
MsgBox Request.ResponseText, vbInformation, "Internal Audit Manager"
End If
Any idea on how to insert a timer and quit after 20 sends will be highly recommended