I get a runtime error number 91: Object variable or With Block variable not set when running this line of code


vb Code:
  1. Debug.Print (picBatch(i).Name & vbCrLf)


that is within this code

vb Code:
  1. Dim i As Integer
  2. For i = 1 To intControlIndex
  3. Debug.Print (picBatch(i).Name & vbCrLf)
  4. Next i

I also get it here


vb Code:
  1. For Index = 1 To UBound(picBatch) Step 1 'as Variant  in picbatch
  2.       For i = 1 To intControlIndex Step 1
  3.         If picBatch(Index).Left = picBatch(i).Left Then
  4.             MsgBox ("We have collided" & picBatch(Index).Name)
  5.     End If
  6.     Next i
  7. Next Index