5 Replies Latest reply: Jun 3, 2013 11:53 AM by Enzo Escobar RSS

    Conditional dimension display with macro



      I want to create a PivotTable through a macro. I need to use a macro because :

           - The dimensions are variables

           - The number of dimensions is variable

           - The number of rows or columns is variable

           - A dimension can be hide with a clic


      I can do it except the last point (when the selection changes, I delete all the dimensions and then I add the dimensions I need). I looked into the API but I didn't find the right method. I tried

      ActiveDocument.GetSheetObject("CH02").GetProperties.Dimensions(0).AttributeExpressions.ShowValueExp.Definition.v = "{condition}"

      but it doesn't work.


      Thank you for your help !