Hi try ..

Sub MyMacro()
'My code....
ActiveWorkbook.RefreshAll
'Or
'ThisWorkbook.RefreshAll
End Sub
Read...
http://www.ozgrid.com/VBA/pivot-table-refresh.htm