title: How to access a VBA array element that was returned from a COM call?
body: <p>In the code below the line </p>
  
  <pre><code>'ActiveCell.Value = nextToGoRacesValue.races(0).raceName    
  </code></pre>
  
  <p>Gives error, sub index out of range, but there are at least 35 elements in the array that was returned, is accessing them as variants the only way? </p>
  
  <p>Is there anythng specific to COM arrays that I should be aware of?</p>
  
  <pre><code>Dim nextToGoRaces As New TABV1_NextToGoRaces
  Dim nextToGoRacesValue As NextToGoRacesValue
  Set nextToGoRacesValue = nextToGoRaces.GetValues()
  
  'ActiveCell.Value = nextToGoRacesValue.races(0).raceName    
  
  Dim element As Variant    
      For Each element In nextToGoRacesValue.races
          ActiveCell.Value = element.raceName    
      Next element
  </code></pre>