Excel to Mac Error

Jonbob

Board Regular
Joined
Feb 6, 2003
Messages
160
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
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

shades

Well-known Member
Joined
Mar 20, 2002
Messages
1,550
Jonbob said:
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?
Not sure how much help on this. I just began playing with this on XL 2004 on Mac. There are several problem areas:

1. Mac version does not seem to support these:
Code:
ActiveWorkbook.PivotCaches.Add

Code:
DefaultVersion:=xlPivotTableVersion10

I think the other parts might work.

I found that I could get the Pivot to work with this:
Code:
    ActiveSheet.PivotTableWizard SourceType:=xlDatabase, SourceData:= _
        "=pivotdata", TableDestination:= _
        "'[Noah Budget (version 1).xls]Analysis'!R2C2", TableName:="PivotTable1"

Now this was just my playing around and isn't exactly what you had (references, etc.), but perhaps it will point you in the right direction.
 

Forum statistics

Threads
1,147,510
Messages
5,741,574
Members
423,668
Latest member
Audorin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top