2 Replies Latest reply on Dec 28, 2011 7:42 AM by vegard

    Delete a symbol from a display using VBA

    vegard

      Adding a symbol to a ProcessBook display is done with the following VBA code:

       
      Dim MySymbol As Symbol
      Set MySymbol = ThisDisplay.Symbols.Add(pbSymbolTBSymbol)
      

      My question is thus: How can it be removed?

      A pbSymbol does not have a .Remove() method as far as I know. Is there another way?

      My workaround is simply to remove the visibility of the symbols, but this is a rather poor solution in my humble opinion.

       

       

        • Re: Delete a symbol from a display using VBA
          andreas

          Vegard,

           

          you need to remove the symbol from the symbol collection:

           
          Dim MySymbolName As String
          
          Private Sub CommandButton1_Click()
              Dim MySymbol As Symbol
              Set MySymbol = ThisDisplay.Symbols.Add(pbSymbolTBSymbol)
              MySymbolName = MySymbol.Name
          End Sub
          
          Private Sub CommandButton2_Click()
              Me.Symbols.Remove (MySymbolName)
          End Sub