0
votes

This is my first time doing excel macro, and I got this error:

Microsoft Excel Macro - Run-time error '438' object doesn't support this property or method

The error is highlighted as this With ActiveWorkbook.PivotTables("PivotTable").PivotFields("Ad Set Name")

Does anyone knows how to resolve this, and thanks in advance!

Best Regards Dex

1
Can you please post some more complete sample code and some context for what you're trying to do?KingOfTheNerds
Workbook does not have PivotTables property, probably it should be ActiveWorksheet.PivotTablesBrakNicku

1 Answers

2
votes

I think you need to use a worksheet reference because the PivotTables collection belongs to a worksheet, not a workbook. So try: With ActiveSheet.PivotTables("PivotTable").PivotFields("Ad Set Name")