ShowDetail on PivotTable does not work in VBA

R

Ray C

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top