You must reference an array with indexes corresponding to the same number of dimensions as appear in the array's declaration. This error has the following cause and solution:
X(2,4)
(an array with two dimensions) when it has been defined as Dim X(5)
(an array with one), generates this error.
Check the declaration of the array and, in the reference, include one index for each dimension in the declaration.
For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).