Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Can any one help me i this
I am using the below code for creating the Straight table dynamically.
Sub Create
Set Obj=ActiveDocument.Sheets("Main").CreateStraightTable
Obj.AddDimension "Sal"
Obj.AddExpression "Sum(Sal)" (i am getting this field in the table with same name but i want to rename it)
End Sub
Now How can i rename that expreession from the macro itself.
Thanks for any help..
Hi,
take a look at QV API-Guide. Here is the example for IGraphProperties.Expressions
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
Regards
Sven
Hi,
Thanks for your reply
But how can i mange these expressions through a loop
Thanks..
Hi,
sorry, but there are thousands of possibilities
set chart = ActiveDocument.ActiveSheet.CreateStraightTable
chart.AddDimension "Customer"
for ...
i=chart.AddExpression your_current_expression
set cp = chart.GetProperties
set expr = cp.Expressions.Item(i).Item(0).Data.ExpressionVisual
expr.Label.v = your_current_label
chart.SetProperties cp
next
you may use two arrays, a dictionary (CreateObject("Scripting.Dictionary")) or what ever you want
Regards
Sven