Hi Vassili, Simon,
Good point, Vassili. The only thing I would change is the name of the property. I would use a name which more describes the content like this:
Call DataFileSave(MyFolders(0)&"test_data.tdms", "TDMS", True)
prop = namesplit(datafilename, "P")
Data.Root.ActiveChannelGroup.Channels(1).Properties.Add("TargetPath").Value = prop
Greetings
Walter