I am sort of surprised this hasn't been covered before.
The calling for the method (in C) is:
SetValues(BSTR Keyword, SAFEARRAY * Data)
I have tried:
handle = win32com.client.Dispatch("My.Application")
vals = (1.1, 2.2, 3.3)
safe_vals = win32com.client.VARIANT(pythoncom.VT_ARRAY | pythoncom.VT_R8, vals)
handle.SetValues("PUT_IT_HERE", safe_vals)
This gives me the error:
TypeError: Objects for SAFEARRAYS must be sequences (of sequences), or a buffer object.
If I just try entering 'vals':
res = handle.SetValues("PUT_IT_HERE", vals)
File "<COMObject My.Application>", line 2, in SetValues
pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, 0, -2147220988), None)
I assume there is some kind of conversion needed to make it compatible with (SAFEARRAY *) but no one has been very clear about this.