First of all, please post code in between code tags as described in the "Welcome..." FAQ! Secondly, what is this
Code:

$range=readexcel2('C:\kix\06292004.XLS',,-1,1)
ReadExcel2($range)


all about? Especially the second line? Why are you feeding the results of the UDF back into the UDF? As the UDF header states, the UDF returns an array if successful. Thus, you'd ascertain the array dimensions via UBOUND as documented in the KiXtart Manual.
_________________________
There are two types of vessels, submarines and targets.