Fixed..

Original example is missing an endif..

 Code:
 CLS
 BREAK ON
 $range=readexcel2(@scriptdir+'\AD.xls',,-1,3)
 IF @error
       "error occured: @serror (@error)"
 ELSE
       FOR $counter=0 TO ubound($range,2)
             ? "first name: " $range[$counter,0]
             ? "last name: " $range[0,1]
             ? "login: " $range[0,2]
             ?
             SLEEP 0.2
       NEXT
 ENDIF
 ?'Script is complete'
 GET $


In the UDF, locate the line:
 Code:
 dim $_[$2-1,$3-1]


Replace with:
 Code:
 redim $_[$2-1,$3-1]


Your code should run fine then..

I am sending a PM to Lonk to fix the original UDF..

Thanks,

Kent


Edited by Kdyer (2008-06-16 10:03 PM)
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's