ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Database refresh crash (https://www.excelbanter.com/excel-programming/275205-database-refresh-crash.html)

Kate Smith

Database refresh crash
 
Hello everyone,

Here is my problem. I have a macro that does the following:
1. downloads data from database to excel range
2. resizes excel ranges depending on the size of the database download
3. refreshes pivot tables based on newly resized ranges.

The problem is that when I run all 3 sections as one routine, the
macro keeps crashing and the message I'm getting is this:

Runtime Error '1004':
Microsoft excel cannot refresh a PivotTable until refresh of the
external data range on which the PivotTable is based is comlete.

I've tried to fix the problem by calling database download from one
routine and resize and refresh from another. Calling two separate
routines gave me the same error message. Also tried to pause the
application for 20 seconds after calling the database download to give
it time but that didn't help much either.

Routine runs fine when I execute it line by line by hitting F8.

Any ideas on how to fix it?

Thanks

Kate


All times are GMT +1. The time now is 12:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com