Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
I was wondering if there is any kind of way that will allow me to add a condition to expressions through macros. At the moment I have a macro that dynamically adds expressions to a chart and I want to make sure the expressions are alwys greater than zero. Otherwise they shouldn't apper in the graph. Looking at the API the only thing I found was EvaluationCondition command, which only applies to table objects though. Any ideas?
So doesn't anyone have any clue about this? I'd be surprised if there is no way to programmatically insert conditions for expressions.
Hi,
I know this is very old thread but have you got around a way to add conditional expressions using VB Script?
Thanks,
DV
Have a look here: Macro for Conditional expression in chart
- Marcus
Recognise that this is quite an old thread but the answer is found in bold and underlined in the example code below:
set chart = ActiveDocument.ActiveSheet.CreateStraightTable
chart.AddDimension "Customer"
chart.AddExpression "sum(Amount)"
set cp = chart.GetProperties
set expr = cp.Expressions.Item(0).Item(0).Data.EnableCondition
expr.Type = 2
expr.Expression = "Sum(Amount)> 500"
chart.SetProperties cp
You first need to enable the tick the conditional option type (=2) then add the expression (you conditional expression).
Thanks,
Long