Hi all! I have a 2003 (.xls) excel wb that uses this code to auto refresh the pivot table. This code is in the worksheet.

Private Sub Worksheet_Activate()
ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh
End Sub
When the workbook is converted to 2007 (.xlsm) the code no longer functions and the pivot table does not refresh.

Can anyone suggest how I may fix this?

Thanks for all the good help over the years and hopefully many more to come!