0

I'm working on some VBA in Excel iterating through some JSON from Jira.

I'm receiving Runtime error 424, Object Required on the 4th line in the code block. I'm able to get the value of the expression in the line above it and I've verified that it is populated with a string. So, I'm misunderstanding something here but I can't see it. Can anyone offer suggestions or help?

Thanks!

    For z = 1 To Issues.count
        If (Not (Issues(z)("fields")("assignee")) Is Nothing) Then
            devName = Issues(z)("fields")("assignee")("name")
            >>>If (Not (Issues(z)("fields")("assignee")("name")) Is Nothing) Then
                Set devRow = New CDeveloperStats
                devRow.Name = devName
            End If
         End If
    Next z
AustinJim
  • 41
  • 1
  • 5
  • 6
    `Is Nothing` is used for tests on objects. The error is saying something like: "You need to have an object to use this condition". `Issues(z)("fields")("assignee")("name")` doesn't return an object. It returns a string. So you can test it with `=""`. Although, that's a little redundant since you already have the value in your `devname` variable. Just `If devName <> "" Then` – JNevill Apr 23 '18 at 14:21
  • [This answer](https://stackoverflow.com/a/46245469/4717755) may help with figuring out how to access and use different parts of a JSON structure. – PeterT Apr 23 '18 at 14:34
  • That did it. Thanks! The redundant code was just for testing. – AustinJim Apr 23 '18 at 15:14

0 Answers0