OK here's the final code that worked for me:

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]+''?
if fnIngroupAD($GroupName)
'' + @ERROR + ' - ' + @SERROR ?
AddToMyNetworkPlaces($ShareName,$SharePath,$Comment)
endif
next



Thanks to Les, Jochen and Gargoyle for their input!

Sincerely,
Jimmy