Hello,
I have the below code which calls an API and returns JSON. The JSON is frequently greater than the Excel cell character limit of 32767, and therefore gets cut off when entered into my sheet. I was wondering if there is any way to divide responses that are over 32767 into multiple cells in the row? Many thanks
VBA code:
Ideal response if "strresponse" > 32767 characters:
I have the below code which calls an API and returns JSON. The JSON is frequently greater than the Excel cell character limit of 32767, and therefore gets cut off when entered into my sheet. I was wondering if there is any way to divide responses that are over 32767 into multiple cells in the row? Many thanks
VBA code:
VBA Code:
Public Sub GetCandNotesAPII()
On Error Resume Next
Dim jobid As Variant
Dim Strresponse As String
Dim candid As String
Dim i As Long
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
Dim Sheet As Worksheet
For i = 2 To FinalRow
candid = ThisWorkbook.Sheets("Sheet4").Range("C" & i).Value
Set Sheet = Sheets("Sheet2")
Const APIkey = "123456abcdef"
Dim httpReq As Object
Set httpReq = CreateObject("MSXML2.XMLHTTP")
Dim rootURL As String, registrationEndpointURL As String
Dim registration As String
Dim text As String
Dim userid As Variant
rootURL = "https://randomAPIURL.com" & candid & "/activity_feed"
With httpReq
.Open "GET", rootURL, False
.setRequestHeader "Authorization", "Basic " & EncodeBase64(APIkey)
.send
Strresponse = .responseText
Worksheets("Sheet4").Range("E" & i).Value = Strresponse
End With
Next i
End Sub
Ideal response if "strresponse" > 32767 characters:
source data | source data | source data | source data | Characters 1-32767 | Characters 32767 - end |