Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Error when runing macro to create pivot table

Hi,
I created a macro (recorded macro)to make a pivot Table.
The generated code is the following:
(...)
Columns("A:H").Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase,
SourceData:= _
"relat!C1:C8").CreatePivotTable
TableDestination:="", TableName:= _
"TD Vendas"
ActiveSheet.Name = "TPVsIva"
ActiveSheet.PivotTableWizard
TableDestination:=ActiveSheet.Cells(3, 1)
ActiveSheet.Cells(3, 1).Select

ActiveSheet.PivotTables("TD Vendas").SmallGrid = False

ActiveSheet.PivotTables("TD Vendas").AddFields
RowFields:=Array( _
"Estrutura", "Dados"), PageFields:="Loja"
(...)
When I run the macro appears an error in the last line,
where I'm adding fields.
The error is : "Run Time Error '1004'" with the
message "It was not possible to execute the
Addfields method of the
PivotTables collection"

Can you help me?

Thanks
Bruno
..


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
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Worksheet Functions 1 May 3rd 08 02:35 PM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Discussion (Misc queries) 1 May 3rd 08 10:52 AM
Record Macro to Create Pivot Table Ken Excel Discussion (Misc queries) 1 April 25th 07 09:42 PM
Can I run a macro to create a pivot table? Eqa Excel Discussion (Misc queries) 2 April 8th 07 06:16 AM
Macro to create pivot table/ chart Saint Excel Programming 2 July 6th 04 08:29 PM


All times are GMT +1. The time now is 11:45 PM.

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"