Created
August 24, 2015 22:23
-
-
Save KentaroAOKI/b66663c33423dba9d9cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Sub ExtractResponseBody(Response As String) | |
'This procedure parses the response and writes down the result | |
On Error GoTo ErrorsHandler | |
Dim Results As Variant | |
Dim InnerResults As Variant | |
Response = Replace(Response, "[[", Chr(9)) | |
Response = Replace(Response, Chr(34), "") | |
Response = Replace(Response, "{", "") | |
Response = Replace(Response, "}", "") | |
Response = Replace(Response, "[", "") | |
Response = Replace(Response, "]", "") | |
Results = Split(Response, Chr(9)) | |
If UBound(Results) = 1 Then | |
InnerResults = Split(Results(1), ",") | |
For Counter = 0 To UBound(InnerResults) | |
Range("A1").Offset(activeCellRow - 1, inputParamsNumber + Counter + 1).Value = InnerResults(Counter) | |
Range("A1").Offset(activeCellRow - 1, inputParamsNumber + Counter + 1).Interior.ColorIndex = 15 | |
Range("A1").Offset(activeCellRow - 1, inputParamsNumber + Counter + 1).Font.Name = "Segoe UI" | |
Next Counter | |
End If | |
ErrorsHandler: | |
If Err.Number <> 0 Then | |
MsgBox "ExtractResponseBody: " & Err.Description | |
End If | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment