Run-time error '1004':
Application-defined or Object-defined error
I want set a cell formula with the code below:
Selection.Formula = "=GETPIVOTDATA(""Value"";$M$26;""M"";1;""Y"";1396)"
Above formula works in the sheet correctly as bellow:
=GETPIVOTDATA("Value";$M$26;"M";1;"Y";1396)
but when I try to assign to appropriate cell with macro, above error shown.
How can I assign this formula to cells, by VBA macro?