3 Replies Latest reply on Dec 5, 2016 11:05 PM by yyang

    Pi Processbook: change the value(string) color using vba

    OscarTorres

      I have a value that comes from a tag let's say 'cdt158' and that brings me the next result "58" 

      what I am trying to figure out is how I can change the color of the font is there something equivalent

      to FillColor but for text, like textColor?

      It is going to work as a multistate because it will have upper and lower limits, but those limits come

      from two different tags(I already have this)

        • Re: Pi Processbook: change the value(string) color using vba
          knightk

          Sure, you could use VBA. Change the LineColor property to change the text colour; but I would usually do something like this in AF instead...have the limit tags as child attribute and add an  "Alarm" (or anything) child attribute which is a simple formula, and setup an enumeration to add digital states as needed. Then use this alarm tag in the multistate instead of the value. This way you can change the rules at any time for how the alarm is set in AF, and change which tags are the limit, or changed to fixed limits, get limits from a linked table etc....

           

           

          I don't know why we can't see the enumeration set data in Processbook when using AF2 though...really annoying

          1 of 1 people found this helpful
          • Re: Pi Processbook: change the value(string) color using vba
            yyang

            One quick question, if you have a tag called: abc123, do you want to see value "23"?

             

            If not, then Kelian is right, the one-line VBA code is:

            Value1.LineColor = vbGreen