Hi Hannah,
That code looks like it is designed to populate an enumeration pull-down control or a list control in a SUDialog. Are you trying to run that code in the SCRIPT panel as a DIAdem script? If you are using a SUDialog, could you post the *.sud file so we can take a look at it? Perhaps the issue is a control name mismatch or something.
As a SUDialog enum/list control populating script, it looks OK to me.
If you're trying to run this code in DIAdem script, then what are your goals for it? You can use a Data.CreateElementList to do something similar in DIAdem to the list control in a SUDialog, just without the user interface element. What are you wanting to accomplish here?
Dim listNum, selectData
Set selectData = Data.CreateElementList()
FOR listNum = 1 TO GroupCount
Set Group = Data.Root.ChannelGroups(listNum)
Call selectData.Add(Group)
NEXT
Brad Turpin
Principal Technical Support Engineer
National Instruments