Showing results for 
Search instead for 
Did you mean: 

Object required in 'CNO(...)'

Go to solution



This is my first time using  DIADEM and VB scripting, apologies in advance, if my question does not make more sense. In the below line of code, i am looking for "If The Definition channel is present or not "

If CNo(GroupTxt & "id_"& TempEmisType & TempChnStr & "Definition_").Properties("Unique_Definition").Value>0 Then

but, its throwing the error saying: Object required :'CNO(...)'

for your reference the above variables hold this values :

GroupTxt  1,

TempEmisType - emissions



And when i am using the old code, which i need to do certain modifications but majority of syntax is same, its still working, old code is:

If CNo(GroupTxt & "Ad_"& TempEmisType & TempChnStr & "DefinitionUnique_")>0

Any help is highly appreciated.
Thanks in Advance

0 Kudos
Message 1 of 3
Accepted by topic author Kandukuri_raghavendra

The upper code does not work because CNO(...) returns a numeric value back and not a group or a channel so


on a numeric will not work. However, you can use the numeric you get back from CNO(...) to get the group and the use ".properties" on it.  Try:

If Data.Root.ChannelGroups(CNo(GroupTxt & "id_"& TempEmisType & TempChnStr & "Definition_")).Properties("Unique_Definition").Value>0 Then


Message 2 of 3

Thank you @gsklyr, will try it.

0 Kudos
Message 3 of 3