View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ray C Ray C is offline
external usenet poster
 
Posts: 20
Default ShowDetail on PivotTable does not work in VBA

I need to programmatically hide the details of one of my row fields in a
pivot table. Manually, you would select the field and click on the Hide
details icon (the yellow minus sign) in the pivot table toolbar.

Programmatically, I thought I needed to set the ShowDetails property of the
pivot item to False:

objSheet.Range("H6").ShowDetails = False

But that doesn't work, apparently, ShowDetails is not a property of the
Range object.

But, when I use the Excel recorder to create a macro for this I get the
following:

Range("G6").Select
Selection.ShowDetail = False

I tried using the Selection object and I still get the same error.

Note that I'm running the code from within MS Access, and I reference the
Excel object library.

Thanks in advance,