Hey everybody,

I'm hoping for some help with the following. I have an Excel file that
has about 20 sheets and nearly every single one contains a pivot table
that pulls data from an external Access database. The pivot tables
then feed reports that are on the same page as each pivot table is.

In my VBA code I have the following

defined in the beginning:
    Dim pt as PivotTable

then later
    Sheets("Sheet 1").Select
    Range("BW26").Select
    Set pt = ActiveSheet.PivotTables("PivotTable1")
    pt.RefreshTable
    Set pt = Nothing

the above code is repeated about 20 times for Sheet 2, Sheet 3, etc.,
i.e. for all sheets on which I have a pivot table that needs to be
refreshed. Some of these pivots take lots of data and take quite some
time to refresh.

Here's the problem: About half way through, say after 8 to 10
refreshed tables, I get the message that I'm low on virtual memory.
Eventually my machine gets so slow that everything just hangs and I
have to reboot. However, when I go into each sheet manually and
refresh the pivot tables manually, I don't have that problem. Where in
my code am I making a mistake that I keep sucking up memory?

Amy help is greatly appreciated!

Thanks,
Christoph
-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us in TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com
<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!

We reach over 6,500 subscribers worldwide and receive many nice notes about the 
learning and support from the group.Let friends and co-workers know they can 
subscribe to group at http://groups.google.com/group/excel-macros/subscribe

Reply via email to