I am running Excel 2002, my buddy is running Excel Version 10- MAC. I checked our Reference Library and we have all the same librabries loaded.
When he runs the code below, he gets the following error:
"Error- Compile error:Method or data member not found"
What do I need to fix?
Sub make_pivot()
Sheets("Analysis").Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
"=pivotdata").CreatePivotTable TableDestination:= _
"'[Noah Budget.xls]Analysis'!R4C1", TableName:="PivotTable4", DefaultVersion _
:=xlPivotTableVersion10
With ActiveSheet.PivotTables("PivotTable4").PivotFields("Vendor")
.Orientation = xlPageField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable4").PivotFields("Expense Type")
.Orientation = xlPageField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable4").PivotFields("Project")
.Orientation = xlPageField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable4").PivotFields("Begin Date")
.Orientation = xlPageField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable4").PivotFields("End Date")
.Orientation = xlPageField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable4").PivotFields("Month")
.Orientation = xlPageField
.Position = 2
End With
With ActiveSheet.PivotTables("PivotTable4").PivotFields("Year")
.Orientation = xlPageField
.Position = 3
End With
With ActiveSheet.PivotTables("PivotTable4").PivotFields("Notes")
.Orientation = xlPageField
.Position = 2
End With
ActiveSheet.PivotTables("PivotTable4").AddDataField ActiveSheet.PivotTables( _
"PivotTable4").PivotFields("Cost"), "Count of Cost", xlCount
Range("B11").Select
With ActiveSheet.PivotTables("PivotTable4").PivotFields("Count of Cost")
.Function = xlSum
.NumberFormat = "#,##0.00"
End With
Range("A3").Select
With ActiveSheet.PivotTables("PivotTable4").PivotFields("Project")
.Orientation = xlRowField
.Position = 1
End With
End Sub
When he runs the code below, he gets the following error:
"Error- Compile error:Method or data member not found"
What do I need to fix?
Sub make_pivot()
Sheets("Analysis").Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
"=pivotdata").CreatePivotTable TableDestination:= _
"'[Noah Budget.xls]Analysis'!R4C1", TableName:="PivotTable4", DefaultVersion _
:=xlPivotTableVersion10
With ActiveSheet.PivotTables("PivotTable4").PivotFields("Vendor")
.Orientation = xlPageField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable4").PivotFields("Expense Type")
.Orientation = xlPageField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable4").PivotFields("Project")
.Orientation = xlPageField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable4").PivotFields("Begin Date")
.Orientation = xlPageField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable4").PivotFields("End Date")
.Orientation = xlPageField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable4").PivotFields("Month")
.Orientation = xlPageField
.Position = 2
End With
With ActiveSheet.PivotTables("PivotTable4").PivotFields("Year")
.Orientation = xlPageField
.Position = 3
End With
With ActiveSheet.PivotTables("PivotTable4").PivotFields("Notes")
.Orientation = xlPageField
.Position = 2
End With
ActiveSheet.PivotTables("PivotTable4").AddDataField ActiveSheet.PivotTables( _
"PivotTable4").PivotFields("Cost"), "Count of Cost", xlCount
Range("B11").Select
With ActiveSheet.PivotTables("PivotTable4").PivotFields("Count of Cost")
.Function = xlSum
.NumberFormat = "#,##0.00"
End With
Range("A3").Select
With ActiveSheet.PivotTables("PivotTable4").PivotFields("Project")
.Orientation = xlRowField
.Position = 1
End With
End Sub