title: Cant't assign to array vba
body: <p>I'm having trouble in my code and i dont know why.. in thhis line "Key = decode.GetKeys(issue)" raises the error mentioned on the title of this question.</p>
  
  <pre><code>Public Sub Import_JSON_From_URL(url As JiraJSONGet)
  
  ThisWorkbook.Sheets("RawData").Activate
  result = url.LoadJson
  
  Dim total As Long
  total = getLastRow()
  
  
  doInit
  Dim Keys() As String
  Keys = decode.GetKeys(JsonObject)
  Dim issues As Object
  Set issues = decode.GetObjectProperty(JsonObject, Keys(4))
  Dim field, issue_project, issue_type, issue_status, issue_summary, issue_report, issue_created, issue_updated, issue_assignee, issue_priority, issue_resolution, issue_resolved, issue_time_spent, issue_time_estimated, issue_project_type As Object
  
  Dim Key(), k_fields(), k_project(), k_issuetype(), k_status(), k_summary(), k_report(), k_created(), k_updated(), k_assignee(), k_priority(), k_resolution(), k_resolved(), k_timespent(), k_timeestimated(), k_projecttype() As String
  
  Dim issue, ki, kf, kproject, kissuetype, kstatus, ksummary, kreport, kcreated, kupdated, kassignee, kpriority, kresolution, kresolved, ktimespent, ktimeestimated As Variant
  
  Dim project_name_issue, project_key_issue, key_issue, issue_type_name, issue_type_description, status_name_issue, summary_key, report_key, created, updated, assignee, priority, resolution, resolved, timespent, timeestimated, today As String
  For Each issue In issues
          Key = decode.GetKeys(issue)
          For Each ki In Key
              If ki = "key" Then
                  key_issue = decode.GetProperty(issue, ki)
                  ThisWorkbook.Sheets("RawData").Range("A" &amp; total + 1).value = key_issue
              End If
              If ki = "fields" Then
                  Set field = decode.GetObjectProperty(issue, ki)
                  k_fields = decode.GetKeys(field)
                  For Each kf In k_fields
  </code></pre>
  
  <p>I have a class named JSONDecoder, with GetKeys function in it: </p>
  
  <pre><code>Public Function GetKeys(ByVal JsonObject As Object) As String()
      Dim length As Integer
      Dim KeysArray() As String
      Dim KeysObject As Object
      Dim index As Integer
      Dim Key As Variant
      Dim value As Variant
  
      Set KeysObject = ScriptEngine.Run("getKeys", JsonObject)
      length = GetProperty(KeysObject, "length")
      ReDim KeysArray(length - 1)
      index = 0
      For Each Key In KeysObject
          KeysArray(index) = Key
          index = index + 1
      Next
      GetKeys = KeysArray
      'value = GetProperty(JsonObject, "issues")
      'Set value = GetObjectProperty(JsonObject, "issues")
  
  End Function
  </code></pre>