Excel - unable to get the pivotfields property of the pivottable class

Asked By dhstein on 05-Jan-10 09:27 PM
In an Excel macro to create a pivot table, I am suddenly getting this
message:  unable to get the pivotfields property of the pivottable class.
This used to work fine and nothing changed.  Any ideas on this?  The code is

With ActiveSheet.PivotTables("PivotSKU").PivotFields("Month-Yr")
.Orientation = xlRowField
.Position = 1
End With

MrSpreadsheet replied to dhstein on 06-Jan-10 02:38 AM
dhstein;603402 Wrote:

Depending on version of Excel you are using, you have probably hit a
limit in the amount of rows that the PivotTable can handle (around 8,000
rows). This is a known issue, still existent in Excel 2003 and 2007 (to
somewhat lesser extent).

In order to resolve the issue, you may need to reduce the number of
PivotFields used. What this does, in effect, is reduces the number of
rows returned as results, hence bypasses the limit.

Many people have had this problem and Microsoft has been very silent
about it and digressing the issue to something else, basically unable to
help people. For a good intro on the subject you may want to read:
'Is an Excel bug that set PivotItem.Visible to true will generate 1004
Macro Error?' (http://tinyurl.com/yese65m)

and search Google with "unable to get the pivotfields property of the
pivot table class"

Hope this has been helpful.

'MrSpreadsheet (MrSpreadsheet) on Twitter'

MrSpreadsheet's Profile: 1365
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=167326

[url="http://www.thecodecage.com"]Microsoft Office Help[/url]