AnsweredAssumed Answered

Get Multi-sate color using VBA macros

Question asked by Israa on Apr 16, 2019
Latest reply on Apr 17, 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 to make an automatic counter that count how many objects 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.