4 Replies Latest reply on Apr 9, 2013 8:48 PM by Ahmad Fattahi

    ProcessBook VBA Script makes values - How can I format decimals and Show Units?

    kpotter

      I have a VBA script which creates a long list of values.  Then for each individual point, I need to:

       

      1. Double click to bring up the "Define Value" form.

       

      2. Under Format-Number, Set to 0.0

       

      3. Check the "Show Units" checkbox.

       

      Does anyone know how to do this programmatically?

       

      Here is my script:

       

      Dim NewSym As Symbol, CurrentTop As Integer, i As Integer

       

      CurrentTop = 14780

       

      For i = 1 To 100

       

           CurrentTop = CurrentTop - 32        

       

           Set NewSym = Symbols.Add(pbSymbolValue)

       

           NewSym.SetTagName ("AF2.\\myServer\myDatabase\ElementPath|Temperature" & Right("00" & Trim(Str(i)), 3))        

       

           NewSym.Left = -14990

       

           NewSym.Top = CurrentTop        

       

           NewSym.Font.Size = 8

       

      Next i        

       

      THANK YOU