I can´t assign the returns to a variable.
If you want remove all expressions you must use chart.RemoveExpression all but I think you already know that.
set chart = ActiveDocument.GetSheetObject("CH01")
set cp = chart.GetProperties
x = cp.Expressions.Item(0).Count
You could count the number of expressions of each chart before remove all of them and use the sentence to remove all:
hope this helps,
Thank you Chema,
but "cp.Expressions.Item(0).Count" returns the number of subexpressions of first expression and "RemoveExpression all" is like "RemoveExpression 0". I think "all" is interprated as a variable with "0" value.
i tryed many ways and finally found out that the code belows has the correct result:
SET chart = ActiveDocument.GetSheetObject("CH01")
SET cp = chart.Getproperties
exprCount = cp.Expressions.Count
FOR i = 1 TO exprCount