Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem creating a pivot table using a macro
I've been trying to create a macro that will create a pivot table
using an existing data matrix. I keep getting an error message as follows: "Unable to get the PivotTables properties of the Worksheet class" Here is the coding where the error occurs: Sheets("Details").Select Range("A1").Select Selection.CurrentRegion.Select ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _ "Details!R1C1:R8822C23").CreatePivotTable TableDestination:= _ "'[Import profile macros.xls]Pivotx'!R1C1", TableName:="PivotTable14", _ DefaultVersion:=xlPivotTableVersion10 ActiveWorkbook.ShowPivotTableFieldList = True With ActiveSheet.PivotTables("PivotTable14").PivotField s("Shipper Name") .Orientation = xlRowField .Position = 1 End With The error seems to occur on the With Activesheet...... line. It seems that the macro can't locate the sheet where the pivot table resides. This problem occurs whether I place the pivot table on a new sheet or on an existing sheet. I have to admit that i am a neophyte when it comes to writing Excel macros. I appreciate any suggestions. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I detail Pivot Table data without creating a table (Excel2007) | Excel Discussion (Misc queries) | |||
How can I detail Pivot Table data without creating a table (Excel2007) | Excel Discussion (Misc queries) | |||
Creating Pivot Tables with macro Problem | Excel Programming | |||
Help with a macro creating a formula for a pivot table | Excel Programming | |||
Creating a pivot table from different sets of data using a macro | Excel Programming |