View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Scott Scott is offline
external usenet poster
 
Posts: 30
Default Pivot Table Macro in Excel 2002

I'm trying to create a macro that will create a Pivot
Table. I'm using the "record" function to record my
steps as I create the Pivot Table.
When I try to run the macro, I get an error: Run-time
error '1004':
AddFields method of PivotTable class failed.

Here's the line in the macro code that fails:
ActiveSheet.PivotTables("PivotTable1").AddFields
RowFields:=Array( _
"Brand Code", "Iams Item Code", "Description"),
ColumnFields:="Date"


Any ideas on what I'm doing wrong?

Thanks,
Scott