Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I'm trying to programmatically update all pivot tables in my workbook without referring any one in particular. The code that I have so far isn't working. Here is the code: For Each ws In ActiveWorkbook.Worksheets For Each pt In ws.PivotTables pt.PivotCache.Refresh Next pt Next ws What am I doing wrong? When I run this code, it virtually freezed my file. Eventually after an hour I believe it might work, but I was wondering if there was more efficient code to do the trick. Thanks, Kent. -- Kent Lysell Financial Consultant Ottawa, Ontario W: 613.948-9557 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Replace
pt.PivotCache.Refresh with pt.RefreshTable -- HTH... Jim Thomlinson "klysell" wrote: Hi, I'm trying to programmatically update all pivot tables in my workbook without referring any one in particular. The code that I have so far isn't working. Here is the code: For Each ws In ActiveWorkbook.Worksheets For Each pt In ws.PivotTables pt.PivotCache.Refresh Next pt Next ws What am I doing wrong? When I run this code, it virtually freezed my file. Eventually after an hour I believe it might work, but I was wondering if there was more efficient code to do the trick. Thanks, Kent. -- Kent Lysell Financial Consultant Ottawa, Ontario W: 613.948-9557 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Jim :-D
-- Kent Lysell Financial Consultant Ottawa, Ontario W: 613.948-9557 "Jim Thomlinson" wrote: Replace pt.PivotCache.Refresh with pt.RefreshTable -- HTH... Jim Thomlinson "klysell" wrote: Hi, I'm trying to programmatically update all pivot tables in my workbook without referring any one in particular. The code that I have so far isn't working. Here is the code: For Each ws In ActiveWorkbook.Worksheets For Each pt In ws.PivotTables pt.PivotCache.Refresh Next pt Next ws What am I doing wrong? When I run this code, it virtually freezed my file. Eventually after an hour I believe it might work, but I was wondering if there was more efficient code to do the trick. Thanks, Kent. -- Kent Lysell Financial Consultant Ottawa, Ontario W: 613.948-9557 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Jim,
I integrated your code and the same thing happens. Excel is inoperable for at least 20 minutes.... There has to be a reason why it practically hangs.... I'll post again tomorrow with the code. Thanks! -- Kent Lysell Financial Consultant Ottawa, Ontario W: 613.948-9557 "Jim Thomlinson" wrote: Replace pt.PivotCache.Refresh with pt.RefreshTable -- HTH... Jim Thomlinson "klysell" wrote: Hi, I'm trying to programmatically update all pivot tables in my workbook without referring any one in particular. The code that I have so far isn't working. Here is the code: For Each ws In ActiveWorkbook.Worksheets For Each pt In ws.PivotTables pt.PivotCache.Refresh Next pt Next ws What am I doing wrong? When I run this code, it virtually freezed my file. Eventually after an hour I believe it might work, but I was wondering if there was more efficient code to do the trick. Thanks, Kent. -- Kent Lysell Financial Consultant Ottawa, Ontario W: 613.948-9557 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I use
ActiveWorkbook.RefreshAll |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Jig
-- Kent Lysell Financial Consultant Ottawa, Ontario W: 613.948-9557 "Jig" wrote: I use ActiveWorkbook.RefreshAll |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Refreshing Pivot Tables | Excel Discussion (Misc queries) | |||
When refreshing pivot tables my pivot table chart type changes | Excel Discussion (Misc queries) | |||
Refreshing Pivot Tables in a Shared Workbook | Excel Discussion (Misc queries) | |||
Refreshing Pivot Tables in a Shared Workbook | Excel Worksheet Functions | |||
Refreshing pivot tables | Excel Programming |