Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating multiple pivot tables from same cache
I have a macro which should create three pivot tables from the same source
data. I can manually create all three sans problem. However, when I execute the code, I get the first two tables, but on the third table, Excel stops with error 1004 on the following statement: Set PT = PTCache.CreatePivotTable(TableDestination:="", _ TableName:="AssetLevels") This is exactly the same statement which starts off the creation of the second table (other than changing the TableName). I'm using XL2002, but I need it to work in XL2000 as well. What am I doing wrong? -- Regards, Fred Please reply to newsgroup, not e-mail |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating multiple pivot tables from same cache
untested but it is probably the "destination" argument. If you leave it blank it will try to create a new sheet - once but if you do it multiple times it may be trying to overwrite the 2nd pivottable. Instead of leaving it blank, you could us
sheets.add after:=sheets(sheets.count Set PT = PTCache.CreatePivotTable(TableDestination:=sheets( sheets.count).range("A1"), TableName:="AssetLevels" or similar |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating multiple pivot tables from same cache
That was it!
For some reason, Excel will, when given a blank destination, create a first pt, and a second pt, but won't create the third. Oh well, live and learn. -- Regards, Fred Please reply to newsgroup, not e-mail "xlbo" wrote in message ... untested but it is probably the "destination" argument. If you leave it blank it will try to create a new sheet - once but if you do it multiple times it may be trying to overwrite the 2nd pivottable. Instead of leaving it blank, you could use sheets.add after:=sheets(sheets.count) Set PT = PTCache.CreatePivotTable(TableDestination:=sheets( sheets.count).range("A1"), _ TableName:="AssetLevels") or similar |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Creating Views within pivot tables | Excel Discussion (Misc queries) | |||
creating a pivot table from 4 pivot tables | Excel Worksheet Functions | |||
Creating Pivot Tables | Excel Discussion (Misc queries) | |||
Creating Pivot Tables using a CSV file | Excel Discussion (Misc queries) | |||
Pivot cache | Excel Discussion (Misc queries) |