+ Reply to Thread
Results 1 to 3 of 3

Updating Web Queries and setting Calculation to Manual

Hybrid View

  1. #1
    Registered User
    Join Date
    08-03-2021
    Location
    County Antrim, Northern Ireland
    MS-Off Ver
    Excel 2003
    Posts
    9

    Updating Web Queries and setting Calculation to Manual

    Using Excel 2003.

    I have a workbook that uses a number of remote references by means of "Web Queries".

    When I want to update the data I click the "Refresh All" button on the "External Data" toolbar.

    This works fine except that the workbook recalculates after each data set refresh, so it all takes quite a while.

    So - I have to set calculation to manual before updating and then back to automatic once updating has completed. This way recalculation only happens once. This works well.

    It occurred to me that I could use a macro to do this and then replace the "Refresh All" button with a button to call my macro. So I tried the following:
    Sub QuickRefreshAll()
    Application.Calculation = xlCalculationManual
    ActiveWorkbook.RefreshAll
    Application.Calculation = xlCalculationAutomatic
    End Sub

    This didn't work as expected. Excel still recalculated after each data set refreshed.

    Where have I gone wrong?

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,545

    Re: Updating Web Queries and setting Calculation to Manual

    In the properties of all queries, disable background refreshing (this option is enabled by default). At the moment it's like this: you issue a command to switch the recalculation to manual, refresh the queries and before they have time to refresh you turn on automatic recalculation. When you turn off background refreshing for all queries, the execution of the macro will wait until the queries refresh and only then will automatic recalculation be turned on.

    Artik

  3. #3
    Registered User
    Join Date
    08-03-2021
    Location
    County Antrim, Northern Ireland
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Updating Web Queries and setting Calculation to Manual

    Quote Originally Posted by Artik View Post
    In the properties of all queries, disable background refreshing (this option is enabled by default). At the moment it's like this: you issue a command to switch the recalculation to manual, refresh the queries and before they have time to refresh you turn on automatic recalculation. When you turn off background refreshing for all queries, the execution of the macro will wait until the queries refresh and only then will automatic recalculation be turned on.

    Artik
    Brilliant! Many thanks Artik. That now works exactly as I wanted.
    Alan

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] VBA to open a workbook with manual calculation and close with automatic calculation
    By thedunna in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-04-2019, 12:28 PM
  2. Replies: 2
    Last Post: 03-08-2016, 09:18 AM
  3. Replies: 6
    Last Post: 10-03-2012, 06:18 AM
  4. Updating External DDE Tables Using a Manual Calculation Trigger Mechanism
    By SDruley in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2011, 05:06 PM
  5. Setting a single worksheet to manual calculation
    By JONNY981 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 02-09-2010, 03:43 PM
  6. Calculation Setting to Manual
    By modytrane in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-15-2008, 11:22 AM
  7. Setting Manual Calculation on Specific Cells Only
    By Jim Hagan in forum Excel General
    Replies: 3
    Last Post: 02-23-2006, 04:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1