LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Code problems for pivot table


Hi there,
I created a pivot table and captured the keystrokes as a recorded macro. But
now when I re-run the code, I get error message 1004: Unable to get the
PivotItems property of the PivotField class. the lspecific line that fails:
ActiveSheet.PivotTables("PivotTable1").DataPivotFi eld.PivotItems("Sum of
Value").Position = 1

The problem results in crerating the pivot tables, but the coulms come out
with a Count of Values instead of Sum of Values.

Here's the entire code:
Range("A1:B1").Select
Range(Selection, Selection.End(xlDown)).Select
'create pt for trust acct
ActiveWorkbook.PivotCaches.Add(SourceType:=xlConso lidation,
SourceData:= _
Array("Sheet1!R1C1:R76C2", "Item1")).CreatePivotTable
TableDestination:= _
"'[Funds Ops Recon 06232009.xls]Sheet1'!R16C10",
TableName:="PivotTable1", _
DefaultVersion:=xlPivotTableVersion10

ActiveSheet.PivotTables("PivotTable1").DataPivotFi eld.PivotItems("Sum of
Value").Position = 1 '<<<<< this line is
where it fails
ActiveWorkbook.ShowPivotTableFieldList = True
Application.CommandBars("PivotTable").Visible = False
ActiveWorkbook.ShowPivotTableFieldList = False

Thanks in advance for any tips

--
Chris Freeman
IT Project Coordinator
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot Table Problems [email protected] Excel Worksheet Functions 3 July 20th 07 05:53 PM
Pivot Table Problems [email protected] Excel Worksheet Functions 0 December 21st 06 03:15 PM
pivot table problems CatherineC Excel Worksheet Functions 3 March 21st 06 11:08 PM
Pivot Table problems Randy Starkey Excel Programming 2 March 31st 05 01:50 AM
Pivot Table Problems Rachel Gonsior Excel Discussion (Misc queries) 3 March 21st 05 07:24 PM


All times are GMT +1. The time now is 05:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"