2 Replies Latest reply: Oct 19, 2017 10:10 AM by Cotiso Hanganu RSS

    Expression label change in Module

    Peyman Azimabadi

      Hi all,

      i need to change the column titles (expression label) of a stright table chart in my VBScript code in module. Anybody has an idea?


      Best Regards


        • Expression label change in Module



          Try the following VB Script, it wil change the first and second expressions labels:


          Sub ChangeLabel

          set Graph =ActiveDocument.GetSheetObject("CH01")

          set p = Graph.GetProperties
          set expr1 = p.Expressions.Item(0).Item(0).Data.ExpressionVisual

          expr1.Label.v = "Sales"
          expr1.NumAdjust = 1    'center
          expr1.LabelAdjust = 1    'center

          set expr2 = p.Expressions.Item(1).Item(0).Data.ExpressionVisual

          expr2.Label.v = "Profit"
          expr2.NumAdjust = 1      'center
          expr2.LabelAdjust = 1    'center

          Graph.SetProperties p


          End Sub