带串联的VBA JSON PUT请求

带串联的VBA JSON PUT请求,json,vba,Json,Vba,这就是我如何构建JSON数组,通过PUT方法发送,在该方法中,我从excel中获取一些单元格值: body = "{""note"":""" & Cells(RowNote, 3).Value & """,""uniqueIdentifier:""" & Cells(RowNote, 2).Value & ",""IdentifierType"":""ACCOUNT_ID"",""CustomerId"":" & userID & "}" 然而,

这就是我如何构建JSON数组,通过PUT方法发送,在该方法中,我从excel中获取一些单元格值:

body = "{""note"":""" & Cells(RowNote, 3).Value & """,""uniqueIdentifier:""" & Cells(RowNote, 2).Value & ",""IdentifierType"":""ACCOUNT_ID"",""CustomerId"":" & userID & "}"
然而,我得到了一个错误13不匹配

这是一个可以正确放置的JSON字符串示例:

{"note":"call again", "uniqueIdentifier":1716, IdentifierType":"ACCOUNT_ID", "CustomerId":927560}

括号内应该更正什么?

如果不需要
围绕整数。

只是一个建议:用撇号替换内部引号,这仍然是一个有效的JSON,但看起来更容易。例如:
body=“{'note':'”&单元格(RowNote,3).Value&“,'uniqueIdentifier':”&单元格(RowNote,2).Value&“,“'IdentifierType':'ACCOUNT_ID','CustomerId':”&userID&“}“
现在,您可以注意到您的code@Banana哈哈,我这么做了,但部分内容显示为绿色评论!很好,这意味着你做错了什么。您在代码转换为注释的地方遗漏了一个引号。请尝试
body=“{”“note”“:”“”和Cells(RowNote,3)。Value&”“,“uniqueIdentifier”“:”“”和Cells(RowNote,2)。Value&”“IdentifierType”“:”“ACCOUNT_ID”“CustomerId”“:”“和userID&”“}
以及此
body=“{”“note”“:”“和Cells(RowNote,3)。Value&”“,”“uniqueIdentifier”“:”&单元格(行注释,2).值和“,”IdentifierType”“:”帐户ID“,”客户ID“:”&用户ID&“}”
如果您不希望整数周围有