Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am looking for macro to disable only conditional expression in a chart but keeping the expression enable.
If anyone has the macro please keep posted here.
I have found macro in API guide for enabling the condition where as I am looking to disable the existed condition for expression
rem create new macro button
set newbutton = ActiveDocument.ActiveSheet.CreateButton
set prop = newbutton.GetProperties
prop.Type = 2
prop.Text.v = "Run macro a"
prop.Macro = "a"
prop.EnableCondition.v = "count(Regions)<2"
newbutton.SetProperties prop
Thanks in Advance !!
Rajender
Thanks for the reply m w.
Yes I have tried but that didn't work. I have tried in another way and found the solution.
set expr = p1.Expressions.Item(1).Item(0).Data.ExpressionData
expr.Definition.v = "count(Regions)<2"
set expr = p1.Expressions.Item(1).Item(0).Data.EnableCondition
expr.Type = 1 '1-Disable, 2- Clear
expr.Expression = ""
This Macro code helps to enable the expression and disables the conditional when you run it.
Have you tried:
prop.EnableCondition.v = ""
Thanks for the reply m w.
Yes I have tried but that didn't work. I have tried in another way and found the solution.
set expr = p1.Expressions.Item(1).Item(0).Data.ExpressionData
expr.Definition.v = "count(Regions)<2"
set expr = p1.Expressions.Item(1).Item(0).Data.EnableCondition
expr.Type = 1 '1-Disable, 2- Clear
expr.Expression = ""
This Macro code helps to enable the expression and disables the conditional when you run it.