1 Reply Latest reply: Apr 20, 2012 6:29 AM by Narasimha K 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

      Peyman

        • Expression label change in Module

          Hello:

           

          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