Thread: pivot macro
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default pivot macro

ha!
I saw that selection but somehow didn't relate it to the
problem I was having.
...put in the correct range and it works like a champ now.

Thanks Tom


-----Original Message-----
Your data source appears to be C1:C11. Not sure how you

would get more than
one field from that.

--
Regards,
Tom Ogilvy

Tony wrote in message
...
Hello,
I have an issue trying to play-back a macro that

creates
a pivot table.
Basically, I recorded the creation of a macro in excel
2000 but when I play it a box pops up with this:

Run-Tinme error '1004'
Unable to get the PivotFields property of the

PivotTable
class.

The pivot table list box that opens up during the
playback only shows one of the fields I created.

Any ideas?

Here's the macro:

Sub macro2()
Cells.Select
ActiveWorkbook.PivotCaches.Add
(SourceType:=xlDatabase, SourceData:= _
"'wsprod1_https-443_warning_get_1'!
C1:C11").CreatePivotTable TableDestination _
:="", TableName:="PivotTable3",
DefaultVersion:=xlPivotTableVersion10
ActiveSheet.PivotTableWizard
TableDestination:=ActiveSheet.Cells(3, 1)
ActiveSheet.Cells(3, 1).Select
ActiveSheet.PivotTables("PivotTable3").PivotFields
("METHOD").Subtotals = Array( _
False, False, False, False, False, False,

False,
False, False, False, False, False)
ActiveSheet.PivotTables("PivotTable3").PivotFields
("Description").Subtotals = _
Array(False, False, False, False, False, False,
False, False, False, False, False, False)
ActiveSheet.PivotTables("PivotTable3").AddFields
RowFields:=Array("METHOD", _
"Description"), PageFields:=Array
("Date", "Time", "Type")
ActiveSheet.PivotTables("PivotTable3").PivotFields
("METHOD").Orientation = _
xlDataField
ActiveWorkbook.ShowPivotTableFieldList = True
Columns("B:B").Select
Selection.ColumnWidth = 40
Range("B1").Select
End Sub



.