Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. Below is the part of code i am using for this.
  2.  
  3. Tag1 = ws.Range("E3:E" & rowCount).Value
  4. Tag2 = ws.Range("F3:F" & rowCount).Value
  5. Tag3 = ws.Range("G3:G" & rowCount).Value
  6. Tag4 = ws.Range("H3:H" & rowCount).Value
  7.  
  8. For i = 1 To UBound(Caps, 1)
  9.  
  10. If runFlag(i, 1) = "Run" Then
  11.  
  12. 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) & "]}"
  13.  
  14. Worksheets("URLsAndJSON").Cells(i + 2, 1) = RequestXML
  15.  
  16. 'xml object
  17. Set http = CreateObject("MSXML2.ServerXMLHTTP.3.0")
  18. http.setOption(2) = 13056
  19. 'open the connection
  20. http.Open "POST", URL, False
  21. http.setRequestHeader "content-type", "application/json"
  22.  
  23. 'Send the input file
  24. http.send RequestXML
  25.  
  26. response = http.ResponseText
  27.  
  28. 'save the response
  29. Worksheets("URLsAndJSON").Cells(i + 2, 2) = response
  30. Worksheets("URLsAndJSON").Cells(i + 2, 3) = http.Status
  31. Worksheets("URLsAndJSON").Cells(i + 2, 4) = http.statusText
  32.  
  33. End If
  34.  
  35. Next
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement