If I'm interpreting the situation right, then you've got a mismatch between the CSV file and the sample table. If aDV[] array is being populated from the CSV and the cFlds[] is populated from the table, then it means you've got more columns in the table than there are in the CSV file.
>Just stepped through. i think the value is greater than the size of the array. When i step through it at the catch error, it shows adv as numeric 48, and the afield amount is 49. There are only 48 fields/columns in the spreadsheet I am trying to import.
>
>
>
>>
>>IF ALEN(aDV, 1) = 0
>> FOR nIdx = 1 TO nCFldCnt
>> nField = cCFlds[nIdx]
>> IF aDV[nField]==["]
>> * Remove surrounding quotes
>>
>> aDV[nField] = SUBSTR( aDV[nField], 2, LEN(aDV[nField])-2 )
>> ENDIF
>> ENDFOR
>>ENDIF
>>
>>
>>You're retrieving value nField from array cCFlds (the value I presume is numeric) -- are you absolutely sure that the value you're obtaining isn't less than 1 or is greater than the size of the array aDV ?