Hi Richard,

Having a another look at your reply, post weekend, and I put the below code into and UDF and included into my code kix file.
 Code:
; Convert a 2D array to an array of 1D arrays
Function Array2Vector($A)
	Dim $i,$t,$e

	Redim $Array2Vector[UBound($A,1)]

	For $i = 0 To UBound($A,1)-1
		Redim $e[UBound($A,2)]
		For $t=0 To UBound($a,2)-1
			$e[$t]=$A[$i,$t]
		Next
		$Array2Vector[$i]=$e
	Next

	Exit 0

EndFunction


I have added the line
 Code:
$Brands = Array2Vector($Brandshop[1])
below
 Code:
$Brandshop = readexcel2(@Scriptdir + '\pccs.xlsx',,-1,-1)
and I get the error
 Quote:
ERROR : array reference out of bounds!
on the line that Array2Vector is called.

I don't know if it is something in the code, or the way it is referenced, but I think it is right.

Pax


Edited by Pax (2010-10-11 01:09 PM)