Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Timing of automatic query refresh and macro pivot table refresh

I have a user form set to load and show upon file open that has two fields
for user parameter entry--Customer, and Start Date. Button macro pastes this
information into cells in Sheet 1 and Sheet 2, which contain queries to an
external database. Queries are set to automatically refresh when the cells
change. Sheet 3 contains 2 pivot tables, which after the pasting from the
user form is done, are coded to refresh (then user form hides). The problem
is, the pivot tables refresh before the queries refresh, because the user has
to select the "Enable Automatic Refresh" button after the user form hides.

Can I use VB code to enable the automatic refresh when the sheet opens, and
then time the refresh of the pivot tables to follow the queries' refresh?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Timing of automatic query refresh and macro pivot table refresh

Hi,
I think it is because the "background query refresh" is enabled ?
To prevent this to happen:
- if refreshing the queries through code, refresh with BackgroundQuery=False
my_queryTable.Refresh False
- if within excel, in the Data Range Properties, uncheck the "Enable
Background Refresh"

Rgeards,
Sebastien

"dutty" wrote:

I have a user form set to load and show upon file open that has two fields
for user parameter entry--Customer, and Start Date. Button macro pastes this
information into cells in Sheet 1 and Sheet 2, which contain queries to an
external database. Queries are set to automatically refresh when the cells
change. Sheet 3 contains 2 pivot tables, which after the pasting from the
user form is done, are coded to refresh (then user form hides). The problem
is, the pivot tables refresh before the queries refresh, because the user has
to select the "Enable Automatic Refresh" button after the user form hides.

Can I use VB code to enable the automatic refresh when the sheet opens, and
then time the refresh of the pivot tables to follow the queries' refresh?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Timing of automatic query refresh and macro pivot table refres

Queries aren't refreshing through code, they are doing so automatically when
the data is pasted from the user form via the "Refresh automatically when
cell value changes" function under Parameters.

I unchecked the "Enable Background Refresh" option and tried to run the
procedure again with the same results--the pivot tables refresh prior to the
queries refresh operation completing??

dutty

"sebastienm" wrote:

Hi,
I think it is because the "background query refresh" is enabled ?
To prevent this to happen:
- if refreshing the queries through code, refresh with BackgroundQuery=False
my_queryTable.Refresh False
- if within excel, in the Data Range Properties, uncheck the "Enable
Background Refresh"

Rgeards,
Sebastien

"dutty" wrote:

I have a user form set to load and show upon file open that has two fields
for user parameter entry--Customer, and Start Date. Button macro pastes this
information into cells in Sheet 1 and Sheet 2, which contain queries to an
external database. Queries are set to automatically refresh when the cells
change. Sheet 3 contains 2 pivot tables, which after the pasting from the
user form is done, are coded to refresh (then user form hides). The problem
is, the pivot tables refresh before the queries refresh, because the user has
to select the "Enable Automatic Refresh" button after the user form hides.

Can I use VB code to enable the automatic refresh when the sheet opens, and
then time the refresh of the pivot tables to follow the queries' refresh?

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
Create refresh button in worksheet to refresh Pivot Table Data Ron Excel Worksheet Functions 1 October 13th 07 01:20 AM
external data automatic refresh through macro/query Texas Tonie[_2_] Excel Discussion (Misc queries) 0 April 12th 07 07:52 PM
How can I 'Enable Automatic Refresh' for Query Refresh by default Anand Deshpande Setting up and Configuration of Excel 0 December 10th 06 04:47 AM
Query Refresh-Enable Automatic Refresh Dialogue Box Terri Excel Discussion (Misc queries) 0 May 6th 05 08:21 PM
Pivot Table REFRESH Flaw -- Saves Old Data in Selection Area AFTER REFRESH Ken Roberts Excel Programming 3 September 11th 03 06:02 AM


All times are GMT +1. The time now is 06:21 AM.

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

About Us

"It's about Microsoft Excel"