You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
wrong number arguments or invalid property assignment when used JsonConverter.ParseJson #290
Hello, I got wrong number arguments or invalid property assignment when used JsonConverter.ParseJson.
I have Sub routines here. In both of them i am using JsonConverter.ParseJson. In first Sub GetIssueIDs it is failing at line " Set jsonText = JsonConverter.ParseJson(response)" with error mentioned in title., where as same works in 2nd SUb., which means i imported all necessary modules correctly.
what is incorrectly being done here.
Sub GetIssueIDs()
Dim http As Object
Dim jsonText As Object
Dim item As Object
Dim url As String
Dim response As String
url = "***********/rest/api/3/search/jql?jql=project%20%3D%20RTAQSR%0AAND%20issuetype%20IN%20standardIssueTypes()%0AAND%20sprint%20%3D%2033879%0AAND%20type%20IN%20standardIssueTypes()%0AORDER%20BY%20created%20DESC%2C%20assignee%20ASC"
Set http = CreateObject("MSXML2.XMLHTTP")
http.Open "GET", url, False
http.setRequestHeader "Accept", "application/json"
http.setRequestHeader "Content-Type", "application/json"
http.setRequestHeader "User-Agent", "Mozilla/5.0"
http.setRequestHeader "Authorization", "Basic ***"
http.Send
If http.Status = 200 Then
response = http.responseText
MsgBox response & "asdfasd"
Sheet1.Range("A1").Value = response
Set jsonText = JsonConverter.ParseJson(response)
MsgBox jsonText
' Loop through issues array
For Each item In jsonText("issues")
Debug.Print "ID: " & item("id")
Next item
' Other fields
Debug.Print "Next Token: " & jsonText("nextPageToken")
Debug.Print "Is Last: " & jsonText("isLast")
Else
Debug.Print "Error: " & http.Status
End If
End Sub
Sub TestJson()
Dim json As Object
Dim response As String
response = "{""issues"":[{""id"":""123""}]}"
Set json = JsonConverter.ParseJson(response)
MsgBox json("issues")(1)("id")
End Sub
Have you checked the failing line with the debugger.
The variable jsonText is badly named since it is declared as Object.
If you try to display this object with Msgbox, since it has no default string property, you will get error 450.
==============
If the above solves your problem, please close the issue.
Activity
Nick-vanGemeren commentedon Apr 5, 2026
Have you checked the failing line with the debugger.
The variable jsonText is badly named since it is declared as Object.
If you try to display this object with Msgbox, since it has no default string property, you will get error 450.
==============
If the above solves your problem, please close the issue.