B
Bruno
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:=xlDatabase,
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"
In the last line, where I'm adding fields, appears a 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
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:=xlDatabase,
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"
In the last line, where I'm adding fields, appears a 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