2 Replies Latest reply: Jun 27, 2014 8:07 AM by Robert Fishel RSS

    Button to expand all fields of a table and export to Excel

    Robert Fishel

      Hello everyone.  Is there a way to create a button that expands all fields in a table and then exports that table to Excel automagically?  Would someone please walk me through this process?  I really appreciate it.  Thank you.

        • Re: Button to expand all fields of a table and export to Excel
          m w

          When you say "expands all fields in a table", I assume it is a pivottable.

          From the API Guide:

               set chart = ActiveDocument.Activesheet.CreatePivotTable

               set gp = chart.GetProperties

               gp.TableProperties.PivotAlwaysFullyExpanded = true

               chart.SetProperties gp

           

          You could write a macro that would set the PivotAlwaysFullyExpanded property to true.

          Then export to Excel.

          Then set the PivotAlwaysFullyExpanded property to false.