堆栈空间中的VBA JSON

时间:2018-02-20 00:12:14

标签: json vba excel-vba class excel

在模块中运行一个Sub。使用VBA-JSON。我试图将JSON字段与VBA中的自定义类链接,它适用于大约7个项目,但是当我到达第8个时,我收到错误

  

超出堆栈空间

以下是代码:

Sub XXX()

    Dim http As Object
    Dim Json As Object
    Dim sql As String

    Set http = CreateObject("MSXML2.XMLHTTP")
    Set clsCl = New clsClient
    sql = "{""cid"": 2028, ""data"": ""client""}"
    http.Open "POST", "https://localhost/xxx.php", False
    http.Send sql

    Set Json = JsonConverter.ParseJson(http.ResponseText)
    clsCl.caseid = Json("caseid")
    clsCl.fname = Json("fname")
    clsCl.lname = Json("lname")
    clsCl.isssn = Json("isssn")
    clsCl.isdob = Json("isdob")
    clsCl.isage = Json("isage")
    clsCl.issex = Json("issex")
    clsCl.facility = Json("snfdr")

End Sub

http.ResponseText内容如下:

{
    "fname": "George",
    "lname": "Jungle",
    "isdob": "0000-00-00",
    "isage": "0",
    "isssn": "2/2/1932",
    "facility": "HIDDENHILLSMANOR",
    "facilityadmitdate": "0000-00-00",
    "issex": "Male",
    "snfdr": "240.00",
    "csfname": "Jane",
    "cslname": "Jungle",
    "csssn": "234-56-7890",
    "csdob": "1937-06-06",
    "csage": "80",
    "cssex": "Female",
    "csaddress": "1212GrapevilleHillRoad",
    "cscsz": "Sarver, PA16000",
    "cstelephone": ""
}

0 个答案:

没有答案