Hi all

I have an excel file with code that opens another excel file and populates excel file with 4 different sheets, each sheet with a different pivot report. In one of the reports I wanted to add a button so that users could clear all the filters in one swoop, and so when I done this I had to change the file to an xlsm file extension.

Once I done this I ran my first excel file - with the VBA - that opens the report file and populates with data, I then got an error:

HTML Code: 
This is the piece of code where it fails and I cannot figure out why it now fails after changing the called file to an xlsm file? ?fails on bold part

 For i = 0 To 3
                
        'define pivot properties
       
        Sheets(Metrics(i)).Select
        ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
                                          RawD & "!R1C1:R" & FinalRow & "C" & FinalCol, Version:=xlPivotTableVersion14).CreatePivotTable _
                                          TableDestination:=Metrics(i) & "!R3C1", TableName:="PivotTable" & i + 1, DefaultVersion _
                                                                                                          :=xlPivotTableVersion14

..........set up pivot fields/filters for other reports (0-3)
Maybe someone knows why changing the file to an xlsm would suddently cause this?

Thanks

G