VBA 400 Error Message

  • Hi,


    I have got a macro to refresh all pivot tables and have this macro on several workbooks, however for some reason now, this macro works on some of the workbooks and for the others I get a 400 error message, I have attached the code below;


    Code
    Dim xWs As WorksheetDim xTable As PivotTable
    For Each xWs In Application.ActiveWorkbook.Worksheets
        For Each xTable In xWs.PivotTables
            xTable.RefreshTable
        Next
    Next
    End Sub


    Thanks

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!