function StringToVariantArray(const S: string): OleVariant;
var
P: Pointer;
begin
Result := NULL;
if Length(S) > 0 then
begin
Result := VarArrayCreate([0, Length(S) - 1], varByte);
P := VarArrayLock(Result);
try
Move(S[1], P^, Length(S));
finally
VarArrayUnlock(Result);
end;
end;
end