View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Lou Sanderson Lou Sanderson is offline
external usenet poster
 
Posts: 26
Default refreshing pivot tables with a macro

Background refresh is set to true for the query the pvt table is based off of
- didnt see such an option for the pvt table itself. Its strange that the
..refreshall is not working for me b/c most of the posts on this topic say to
do that...

"Dave Peterson" wrote:

From VBA's help for .refreshall:

Remarks
Objects that have the BackgroundQuery property set to True are refreshed in the
background.

Maybe you want to change property to true.

Lou Sanderson wrote:

Windows XP, Excel 2002 SP 3

I have a simple macro that I run to refreshs all my external datasources in
my spreadsheet. Recently I've added some pivot tables as well. I would like
my macro to refresh the pivot tables if possible - currently it does not. Any
suggestions?

Here is my macro

sub macro1()

application.displayalerts = false
sheets("sheet1").select
range("a1").select
activeworkbook.refreshall
application.displayalerts = true
msgbox("refresh complete")
end sub

Thanks,
Lou Sanderson


--

Dave Peterson