You just need to DIM the $list first.

Code:
Dim $list
$objDomain = GetObject("WinNT://"+@Domain)
$count=0
For Each $objComputername In $objDomain
If $objComputername.Class = "Computer"
redim preserve $list[$count]
$list[$count] = $objComputername.Name
$count=$count+1
EndIf
Next
$null=messagebox(UBound($list),"Computer",0)



Works fine for me...