Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JR JR is offline
external usenet poster
 
Posts: 92
Default VBA to update Pivot table

Hello,

Can someone provide the code I can use to automatically update my pivot
tables upon opening the workbook.

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default VBA to update Pivot table

Why use code? Pivot tables have an option to refresh on open under the table
options if I recall correctly.
--
HTH...

Jim Thomlinson


"JR" wrote:

Hello,

Can someone provide the code I can use to automatically update my pivot
tables upon opening the workbook.

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default VBA to update Pivot table

Yes, Jim was right.

You just need to right-click the pivot table, choose "Table Options". Check
the "Refresh On Open" checkbox. (And save you file.)

In case you really want to know the statement for updating a Pivot table, it
will look like this:
ActiveSheet.PivotTables(1).PivotCache.Refresh

Regards,
Edwin Tam

http://www.vonixx.com


"Jim Thomlinson" wrote:

Why use code? Pivot tables have an option to refresh on open under the table
options if I recall correctly.
--
HTH...

Jim Thomlinson


"JR" wrote:

Hello,

Can someone provide the code I can use to automatically update my pivot
tables upon opening the workbook.

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA to update Pivot table


excel 9 (2000) and VBA 6 on XP

If I open a workbook with pivot tables linked to database and set for
'refresh on open'; i get a 'query refresh' dialog asking if i want to
update. Fine, i can click yes, update. The pivot tables then update.

However.... If I use code to open the same workbook, no dialog
appears, and no automatic query / pivot table updates take place.

my question is:

can i force the pivot tables in a workbook to refresh when opened using
code?

I guess i will have to do the following:

open workbook
loop through worksheets
loop through all pivot tales on worksheet
refresh pivot table
next
next
close workbook

andy other ideas on a quick way to force all to be updated? Afterall,
you can refresh data from any linked FILES to on file open...

any good ideas folks?????

andy


--
Andy Warner
------------------------------------------------------------------------
Andy Warner's Profile: http://www.excelforum.com/member.php...o&userid=31363
View this thread: http://www.excelforum.com/showthread...hreadid=535046

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot Table Update Dale Excel Discussion (Misc queries) 6 October 25th 09 09:00 PM
Pivot Table update johnsail Excel Discussion (Misc queries) 8 March 26th 09 08:55 PM
Pivot Table Update Lambi000 Excel Discussion (Misc queries) 1 January 30th 08 08:08 PM
Pivot Table update Talheedin Excel Discussion (Misc queries) 0 August 23rd 06 11:05 AM
How to update pivot table items? RADO Excel Programming 4 October 30th 03 03:07 AM


All times are GMT +1. The time now is 09:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"