Hi Sarm,
First start with a newly launched DIAdem, then execute your above code with the following changes. Note the 3rd parameter in the first line and the missing underscore_ in the third line.
Call OdsValAlloc("Elvis", "ODS_TYPE_STRING", 0)
Elvis = "Graceland"
MsgBox Elvis
Call OdsValFree("Elvis")
Let me know if this still gives you trouble,
Brad