Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Below is the part of code i am using for this.
- Tag1 = ws.Range("E3:E" & rowCount).Value
- Tag2 = ws.Range("F3:F" & rowCount).Value
- Tag3 = ws.Range("G3:G" & rowCount).Value
- Tag4 = ws.Range("H3:H" & rowCount).Value
- For i = 1 To UBound(Caps, 1)
- If runFlag(i, 1) = "Run" Then
- RequestXML = "{""Caps"":""" & Caps(i, 1) & """,""pros"":""" & pros(i, 1) & """,""lookAheadTag"":""" & NumberOfTags(i, 1) & """,""Tag"":[" & Tag1(i, 1) & "," & Tag2(i, 1) & "," & Tag3(i, 1) & "," & Tag4(i, 1) & "]}"
- Worksheets("URLsAndJSON").Cells(i + 2, 1) = RequestXML
- 'xml object
- Set http = CreateObject("MSXML2.ServerXMLHTTP.3.0")
- http.setOption(2) = 13056
- 'open the connection
- http.Open "POST", URL, False
- http.setRequestHeader "content-type", "application/json"
- 'Send the input file
- http.send RequestXML
- response = http.ResponseText
- 'save the response
- Worksheets("URLsAndJSON").Cells(i + 2, 2) = response
- Worksheets("URLsAndJSON").Cells(i + 2, 3) = http.Status
- Worksheets("URLsAndJSON").Cells(i + 2, 4) = http.statusText
- End If
- Next
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement