VB help! - Run-time error ‘438’: Object doesn’t support this property or method.

FiservEFTSalesOps

New Member
Joined
Dec 7, 2009
Messages
31
This is probably simple for many of you.....

I need help to understand why this works with Excel 2007 but not Excel 2003.

I have a button on a worksheet that's assigned a macro that shows only the sub-totals of a pivot table. It works fine for me in Excel 2007, but when I send the file (saved as 2003 format) to someone using Excel 2003, they get: Run-time error ‘438’: Object doesn’t support this property or method.


Can anyone help?

"B6" is the 1st column header of the pivot table [month]

Here's the Macro code:

Sub Show_Mo_ST_Only()<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
' Show_Mo_ST_Only Macro<o:p></o:p>
' show only the monthly sub-totals and the GT of the pivot table<o:p></o:p>
Range("B6").Select<o:p></o:p>
ActiveSheet.PivotTables("PivotTable3").PivotFields("Month").ShowDetail = False<o:p></o:p>
Range("B5").Select<o:p></o:p>
Selection.End(xlToRight).Select<o:p></o:p>
Selection.End(xlToRight).Select<o:p></o:p>
Selection.End(xlToLeft).Select<o:p></o:p>
End Sub<o:p></o:p>
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
ShowDetail method was added in Excel 2007. It's not available in earlier versions.
 
Upvote 0
Thanks, I really appreciate the response.

So there's no way to automate via a button/macro showing and hiding the detail in a 2003 pivot table other than the menus? I have a user-base that's pivot illiterate and I'm trying to make it easy fro them to navigate.

Any suggestions?
 
Upvote 0
I think you would have to use the ShowDetail of the Range class to accomplish the same result. PivotSelect method will return a Range object.
 
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,107
Members
452,302
Latest member
TaMere

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top