I had a piece of code to send data to a HTTP end point
Set xhr = CreateObject("MSXML2.XMLHTTP")
xhr.Open "POST", URL, False
xhr.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
Data = "volumeDate=" & URLEncode(VolumeDate) & "&" & "volume=" & URLEncode(Volume)
xhr.Send Data
I want to have a try catch block to handle if it didnt connect to the URL or if it returned something apart from a 200
How do I do it?