Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hola
me gustaría saber qué propiedad o función debo utilizar para cambiar la propiedad "Habilitar" de una expresión perteneciente a una Pivot Table pero desde un procedimiento de Macro.
Mi objetivo es Habilitar o NO habilitar la expresión en función de una condición y en la versión QV10 no lo puedo hacer directamente (la opción de meter la expresión como dimensión para usar su propiedad condicional no me sirve en este caso)
Me podéis ayudar.
Muchas gracias
this is the macro:
where
vRaw_Wos is the variable to be assigned to a button (to hihe and show the expression)
CHRawData is the object containing the variable
cp.Expressions.Item(0). is the first expression
Sub myMacro
set v = ActiveDocument.GetVariable("vRaw_Wos")
select case v.GetContent.String
case 1
v.SetContent "0",true
set chart = ActiveDocument.GetSheetObject("CHRawData")
set cp = chart.GetProperties
set expr = cp.Expressions.Item(0).Item(0).Data.ExpressionData
expr.Enable = false
chart.SetProperties cp
case else
v.SetContent "1",true
set chart = ActiveDocument.GetSheetObject("CHRawData")
set cp = chart.GetProperties
set expr = cp.Expressions.Item(0).Item(0).Data.ExpressionData
expr.Enable = true
chart.SetProperties cp
end select
end sub
let me know
this is the macro:
where
vRaw_Wos is the variable to be assigned to a button (to hihe and show the expression)
CHRawData is the object containing the variable
cp.Expressions.Item(0). is the first expression
Sub myMacro
set v = ActiveDocument.GetVariable("vRaw_Wos")
select case v.GetContent.String
case 1
v.SetContent "0",true
set chart = ActiveDocument.GetSheetObject("CHRawData")
set cp = chart.GetProperties
set expr = cp.Expressions.Item(0).Item(0).Data.ExpressionData
expr.Enable = false
chart.SetProperties cp
case else
v.SetContent "1",true
set chart = ActiveDocument.GetSheetObject("CHRawData")
set cp = chart.GetProperties
set expr = cp.Expressions.Item(0).Item(0).Data.ExpressionData
expr.Enable = true
chart.SetProperties cp
end select
end sub
let me know
This run perfectly.
Thank you very much