View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Philip Philip is offline
external usenet poster
 
Posts: 156
Default Impossible to find error

Ok,

First, check the name of the activesheet - is the activesheet (referenced by
the code) the worksheet that has the pivot table on it.

Then, if it's referencing the correct worksheet, check the fieldnames of the
pivot table.

Exactly which line of code gives the error?

Philip

"Rossy" wrote:

Here's the code

Cells.Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _
"Report_Incasso_Macro_Ramo!C1:C30").CreatePivotTab le
TableDestination:="", _
TableName:="Tabella_pivot1", DefaultVersion:=xlPivotTableVersion10
ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1)
ActiveSheet.Cells(3, 1).Select
With ActiveSheet.PivotTables("Tabella_pivot1").PivotFie lds("AGENZIA")
.Orientation = xlRowField
.Position = 1
End With
With ActiveSheet.PivotTables("Tabella_pivot1").PivotFie lds("MACRO-RAMO")
.Orientation = xlRowField
.Position = 2
End With
With ActiveSheet.PivotTables("Tabella_pivot1").PivotFie lds("Tipo")
.Orientation = xlRowField
.Position = 3
End With
ActiveSheet.PivotTables("Tabella_pivot1").AddDataF ield
ActiveSheet.PivotTables( _
"Tabella_pivot1").PivotFields("Somma Di SommaDiNetto"), _
"Conteggio di Somma Di SommaDiNetto", xlCount
ActiveSheet.PivotTables("Tabella_pivot1").AddDataF ield
ActiveSheet.PivotTables( _
"Tabella_pivot1").PivotFields("Somma Di Netto_Gennaio"), _
"Conteggio di Somma Di Netto_Gennaio", xlCount
ActiveSheet.PivotTables("Tabella_pivot1").AddDataF ield
ActiveSheet.PivotTables( _
"Tabella_pivot1").PivotFields("Somma Di Netto_Febbraio"), _
"Conteggio di Somma Di Netto_Febbraio", xlCount
End Sub