VBA-tools/VBA-JSON

Not every "key: value" is in the file so it issues an error

cityba opened this issue · 1 comments

@timhall Throws an error at dump, these are not everywhere:
Type mismatch value-- "accounts":[
"1eb6acd7-2f92-452e-a2e8-e326f86246d7"
],

And "creditorAccount":{
"iban":"HU19117122350745555400000000"
},
What is the solution to n be an error?

You haven't provided the code which gets the error. :{
After ParseJSON, the keys mentioned will each point to a Collection with 1 item (but possibly 0 or more for other queries).
The Type mismatch is almost certainly due to missingSet keywords.
If the variable dataDict points to the level above, code to access the items might look like:

    Dim i, aColl As Collection
    Set aColl = DataDict("accounts")
    For i = 1 To aColl.Count
        Debug.Print aColl(i)
      Next