I'm trying to gather info from an excel sheet and using that information to be used on a fnGroupAD() and AddToMyNetworkPlaces() function. I've managed to use the readexcel2(), fngroupAD(), and AddToMyNetworkPlaces() function. Unfortunately, I have not successfully figured out how to output the information gathered from an excel sheet to be used in these functions.

Here's the code I'm managed to get so far(I did not include the functions):

Code:

$range=readexcel2('C:\test.xls',,-1,4,1,1)
if @error
"error occured: @serror (@error)"
else
for $counter=1 to ubound($range)
$GroupName='$range[$counter,0]'
$ShareName='$range[$counter,1]'
$SharePath='$range[$counter,2]'
$Comment='$range[$counter,3]'
select fnGroupAD("$GroupName")
case AddToMyNetworkPlaces('$ShareName','$SharePath','$Comment')
endif
next



It reads excel data and outputs correctly when I use the following output query:

Code:

? ""$range[$counter,0]
? ""$range[$counter,1]
? ""$range[$counter,2]
? ""$range[$counter,3]



It's probably simple that I have missed with the "For Next" command. If you can point me to the right direction, it would be greatly appreciated.

Thanks,
Jimmy