Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is it possible to add a comment to an expression with a macro? I see a function call Comment defined within the iExpressionData class, but there is no example and when I try the following
set chart = ActiveDocument.getSheetObject("ReportBuilder")
set chartProperties = chart.GetProperties
set chartExpressions = chartProperties.Expressions
set chartExpression = chartExpressions.Item(j).Item(0).Data
chartExpression.ExpressionVisual.Label.v = Metric & "(This)"
chartExpression.ExpressionData.Comment.v "='$(" & Metric & ")'"
I get an error that this property or method does not exist. I've tried with and without the ".v". Has anybody been able to add a comment by using a macro?
Thanks, Karl
Hi
This worked for me:
sub test
set chart = ActiveDocument.GetSheetObject("CH30")
set p = chart.GetProperties
set expr = p.Expressions.Item(0).Item(0).Data.ExpressionData
expr.Comment = "sum(Amount)"
chart.SetProperties p
end sub
Hi
This worked for me:
sub test
set chart = ActiveDocument.GetSheetObject("CH30")
set p = chart.GetProperties
set expr = p.Expressions.Item(0).Item(0).Data.ExpressionData
expr.Comment = "sum(Amount)"
chart.SetProperties p
end sub