I have the following code which works perfect well in one workbook but when I run in another provides me with Run-time error '-2147418113(8000ffff) Automation error Catastrophic Failure.

Does anyone have any idea as to why this happens and further more have a solution to resolve this?

Cheers

Sub RefreshSlicer()
'
'Updates Slicer with last 32 entries
'
     Dim lngIndex As Long
     Dim blnSelected As Boolean
'
     With ThisWorkbook.SlicerCaches("Slicer_FinishedDate")
         blnSelected = True
         For lngIndex = 1 To .SlicerItems.Count
             If lngIndex > 32 Then
                 blnSelected = False
             End If
             .SlicerItems(lngIndex).Selected = blnSelected
         Next
     End With
End Sub