Hi,

When I refresh a Pivot Table trough VBA, the horizontal axis date format changes. It has to be dd/mm/yyyy, but automatically changes to U.S. date format mm/dd/yyyy.

If I refresh the table manually in excel works fine and the format doesn't change.

I've searched trough this forum, google, microsoft... for an answer, but I've found nothing useful...

My code:

Dim pt As PivotTable


For Each pt In ActiveSheet.PivotTables
        pt.RefreshTable
        'After this, the format changes
    Next pt
    
ActiveSheet.ChartObjects(1).Activate
ActiveChart.Axes(1).Select
Selection.TickLabels.NumberFormat = "dd/mm/yyyy;@"