Quantcast
Viewing all articles
Browse latest Browse all 50162

Reecorded macro deosn't work on play back

Hi,

I recorded a macro that involved a pivot table for a template and on playback the macro gives a run time error 5 on this bit of code:

Code:

ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
        "Investor Data!R1C1:R10000C65", Version:=xlPivotTableVersion14). _
        CreatePivotTable TableDestination:="% Investor!R3C2", TableName:="PivotTable1" _
        , DefaultVersion:=xlPivotTableVersion14

How is this possible when I recorded this myself? All I changed in the code was the range and the destination

Thanks

readered

Viewing all articles
Browse latest Browse all 50162

Trending Articles