录制宏所得数据透视表一直报错
想调出数据透视表,就录了一个宏,但运行时总弹出‘5’,无效的过程调用或参数”。十分困惑
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"BMW!R1C1:R1048576C2", Version:=xlPivotTableVersion15).CreatePivotTable _
TableDestination:="BMW!R1C7", TableName:="数据透视表1", DefaultVersion:= _
xlPivotTableVersion15
Sheets("BMW").Select
Cells(1, 7).Select
With ActiveSheet.PivotTables("数据透视表1").PivotFields("Summe")
.Orientation = xlRowField
.Position = 1
End With