Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Pivot table error

I have the following codes. It works fine the first time I run it. The next
time I run it there is a error message "Method create pivot table of object
pivotcache failed". It will only work fine if I exit Excel and run the codes
again. Anyone knows why there is a error. The code stops at the "Set PT" row.
FYI, I set PTCache and PT to nothing before I exit the codes.

Set PTCache =
Workbooks("Template.xls").PivotCaches.Add(SourceTy pe:=xlDatabase, _
SourceData:=Range("A1").CurrentRegion.Address)

Set PT = PTCache.CreatePivotTable(TableDestination:="",
TableName:="PivotTable1")
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Pivot table error

Found the cause. Empty headers.
--
help needed


"linglc" wrote:

I have the following codes. It works fine the first time I run it. The next
time I run it there is a error message "Method create pivot table of object
pivotcache failed". It will only work fine if I exit Excel and run the codes
again. Anyone knows why there is a error. The code stops at the "Set PT" row.
FYI, I set PTCache and PT to nothing before I exit the codes.

Set PTCache =
Workbooks("Template.xls").PivotCaches.Add(SourceTy pe:=xlDatabase, _
SourceData:=Range("A1").CurrentRegion.Address)

Set PT = PTCache.CreatePivotTable(TableDestination:="",
TableName:="PivotTable1")

Reply
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 #VALUE! Error ! Tufail Excel Discussion (Misc queries) 2 October 15th 09 05:15 PM
XML error in Pivot Table Twlvman8 Excel Discussion (Misc queries) 0 February 11th 09 05:03 PM
Pivot Table Error Robert_DubYa Excel Discussion (Misc queries) 0 October 29th 08 02:02 PM
Pivot table error Shawn G. Excel Discussion (Misc queries) 0 February 12th 07 10:17 PM
Pivot Table error (424) GDCross Excel Programming 0 May 29th 06 06:34 PM


All times are GMT +1. The time now is 05:17 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"