Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
What is the syntax in VBScript to change the label of an Expression. For instance, I add this expression in a Pivot Table:
Hlo.AddExpression "Sum(ExpenseBudget)/1000"
and I would like the Expression to be labelled as "Expense"
set chart = ActiveDocument.ActiveSheet.CreateStraightTable
chart.AddDimension "Customer"
chart.AddDimension "ProductType"
chart.AddExpression "sum(Amount)"
set cp = chart.GetProperties
set expr = cp.Expressions.Item(0).Item(0).Data.ExpressionVisual
expr.Label.v = "Sales"
expr.NumAdjust = 1 'center
expr.LabelAdjust = 1 'center
chart.SetProperties cp
thanks for reply
in prop.Expressions.Item(0).Item(0).Data.ExpressionVisual
i understand that prop.Expressions.Item(0) is the first expressions in the list of expressions for this chart. What does the second item(0) refers to ? What is Data and what is ExpressionVisual for ?
Thanks
First item is the group of expressions, the second is the expression in group.
Look for "API Guide" to understand all the properties.