Good morning,
I am trying to to use the VBA function Evaluate as per below
Function eval(formula As String) As Variant
eval = Application.Evaluate(formula)
End Function
If A1 I put '=3+2' it works perfectly.
If in A1 i put '=GETPIVOTDATA("[Measures].[Total Rev Disc USD]";$I$1) - where $I$1 is my PowerPivot - I get #Value!
Please note that if instead I use the Named Formulas =EVALUATE($A$1) it works perfectly.
How can I make Evaluate to work in VBA to use GetPivotData?
I even tried with a non-Power Pivot and results are the same.
Thank you!
Fabio
I am trying to to use the VBA function Evaluate as per below
Function eval(formula As String) As Variant
eval = Application.Evaluate(formula)
End Function
If A1 I put '=3+2' it works perfectly.
If in A1 i put '=GETPIVOTDATA("[Measures].[Total Rev Disc USD]";$I$1) - where $I$1 is my PowerPivot - I get #Value!
Please note that if instead I use the Named Formulas =EVALUATE($A$1) it works perfectly.
How can I make Evaluate to work in VBA to use GetPivotData?
I even tried with a non-Power Pivot and results are the same.
Thank you!
Fabio