AnsweredAssumed Answered

How to get the colour of the current Multistate using VBA

Question asked by Israa on Apr 4, 2019
Latest reply on May 8, 2019 by Israa

Hello Everyone,


I have a group of objects in PI-PB display where I applied multistate for all of them using PI calculation, so if the value of my calculation is less than 10% the object will turn green, if its greater than 10% the object will turn red. Now is there a way to get the color of the current status for each one of them in VBA macros, because I need make an automatic counter that count how many objects are in green and how many are in red.


I tried to use the GetMultiState property in this way:


If ThisDisplay.Shorthorizontalpipe_13.GetMultiState.CurrentState = 65280 Then

    countDP1G = countDP1G + 1


But it didn't work properly, so if anyone can guide me to the correct way it will be great.