well here is the part of my code

VB Code:
  1. Private msngMouseX()    As Single
  2. Private msngMouseY()    As Single
  3.  
  4.  
  5. Private Sub xic_MouseMove( _
  6.     Index As Integer, _
  7.     Button As Integer, _
  8.     Shift As Integer, _
  9.     x As Single, _
  10.     Y As Single _
  11. )
  12.     If (Button = vbLeftButton) Then
  13.         xic(Index).Move (xic(Index).Left + x - msngMouseX(Index)), _
  14.                            (xic(Index).Top + Y - msngMouseY(Index))
  15.  
  16.       Else
  17.         msngMouseX(Index) = x
  18.         msngMouseY(Index) = Y
  19.  
  20.     End If
  21. End Sub

well it runs fine but at run time when i m moving instances of Xic in my workspace here and there .. after some time .. VB prompts as " run time error '9' subscript out of range " ..
and hightlights this line in yellow

msngMouseX(Index) = x

what should i do to get rid of this problem