Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello World 🙂
i need help for deleting dimensions and expressions from a Graph with macro...
It' possible to develop a macro that allows to delete a dimension knowing only the name of the dimension?
There is a way to get the index of a dimension knowing only the name of the Dimension?
Please see the attached file.
Thak you all.
Raffaele
Found the solution.
Function gestiscidimensione()
dim i, titolo, ud
sChartId = "personalizzata"
set table = ActiveDocument.GetSheetObject(sChartId)
ud = table.GetProperties().Dimensions.count-1
if (ActiveDocument.Variables("b_dimensione").getcontent.string)=1 then
Table.AddDimension (ActiveDocument.Variables("v_dimensionebld").getcontent.string)
set cp = table.GetProperties
set dims = cp.Dimensions
dims(dims.Count-1).Title.v = (ActiveDocument.Variables("v_dimensionebld").getcontent.string)
table.SetProperties cp
else
for i=0 to table.GetProperties().Dimensions.count-1
titolo = table.GetProperties().Dimensions.Item(i).Title.v
if titolo=(ActiveDocument.Variables("v_dimensionebld").getcontent.string) then
Table.RemoveDimension i
exit for
end if
next
end if
end Function
Thanks but I had already seen this tread but does not solve my problem...
Hi ,
Conditional dimension display with macro
Hope this helps you out,
Hirish
Are you really sure that you need macro-routines which delete dimensions and maybe also create which one or even whole objects - quite often you could get similar results if you used objects with conditions on the objects, dimensions and expression.
- Marcus
Don't use macros, use 'Conditional Show'. That one will work in the AccessPoint too.
i know... but this is the request of our customer:
1. Starting from an empty graph
2. Ad Dimensions to the graph (by clicking a different button for each dimension)
3. Add Expressions to the graph (by clicking a different button for each expression)
4. Save Configuration duplicating the graph
so i can't use conditional show.
I can easily add dimensions and expressions to my object but i can't remove them because i'm expected to state dimensions and expressions index and not their names.
thanks
Does your customer know that there are other possible ways to create and use dynamic charts? What are the features which only a macro provided - I didn't understand your fourth point with "save configuration" - what will be saved for which reason?
- Marcus
Found the solution.
Function gestiscidimensione()
dim i, titolo, ud
sChartId = "personalizzata"
set table = ActiveDocument.GetSheetObject(sChartId)
ud = table.GetProperties().Dimensions.count-1
if (ActiveDocument.Variables("b_dimensione").getcontent.string)=1 then
Table.AddDimension (ActiveDocument.Variables("v_dimensionebld").getcontent.string)
set cp = table.GetProperties
set dims = cp.Dimensions
dims(dims.Count-1).Title.v = (ActiveDocument.Variables("v_dimensionebld").getcontent.string)
table.SetProperties cp
else
for i=0 to table.GetProperties().Dimensions.count-1
titolo = table.GetProperties().Dimensions.Item(i).Title.v
if titolo=(ActiveDocument.Variables("v_dimensionebld").getcontent.string) then
Table.RemoveDimension i
exit for
end if
next
end if
end Function