Syntax problem with Evaluate and @Transform

I have a syntax problem, I cannot obtain a result.NamesList is an array of full hierarchical names that I want to transform in a list of CN names.

What is wrong in the code ?

Function CNListofNames(NamesList As Variant) As Variant

On Error Goto err_Handle

If NamesList(0) = "" Then

	Msgbox "List of names to simplify is empty", 0+16, "Aborting"

	End

End If

CommonNameFormula$ = { @Transform( } & NamesList & {" ; " x" ; @Name([CN]; x) ) }

CNListofNames = Evaluate(CommonNameFormula$)

GetOut:

Exit Function

err_Handle:

Error Err, Error$ & " [In " & Lsi_info(2) & " ]"

Resume GetOut	

End Function

Thanks.

Subject: Syntax problem with Evaluate and @Transform

Hi Pierre

The problem with the code is as follows

The variable “CommonNameFormula$” is a string and “NamesList” is an array.

So trying to concat a string and with an array and assigning to a string variable will result in a type mismatch.

So you can use a “For” or “Forall” loop instead of a @transform with evaluate