+ Reply to Thread
Results 1 to 2 of 2

VBA for updating data from SQL one by one

  1. #1
    Registered User
    Join Date
    12-09-2016
    Location
    london
    MS-Off Ver
    2013
    Posts
    12

    VBA for updating data from SQL one by one

    Hi,

    I have a problem with updating my workbook via refresh all button.

    I think the problem is in a large amount of SQL queries in a workbook.

    Is it possible to write a VBA macro for updating data connection one by one?

    Thank you!

    John.

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: VBA for updating data from SQL one by one

    The code to refresh a specific connection is:
    Please Login or Register  to view this content.
    If you go to Data -> Connections and click on a connection and then click on properties, one of the properties is to allow background refresh. If you turn this off for all the connections, they will be run sequentially. I don't know if that will help. I generally turn off background refresh so my vba stops and waits for the connection to finish updating before I do things like refresh pivot tables.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ 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] Macro tools to import data w/ new line items while updating the data in new WB
    By learningxlsm in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-25-2016, 01:43 PM
  2. Updating data from a main list after data has been split into smaller lists using VBA
    By lukeafuller in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-25-2014, 03:22 AM
  3. Replies: 1
    Last Post: 05-14-2014, 08:24 AM
  4. Replies: 2
    Last Post: 02-27-2012, 10:45 PM
  5. Pivot Tables and VBA: Changing Contents in Data Area and updating the Data Source
    By kyrgyzstanart in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-22-2011, 11:11 AM
  6. Duplication data every time macro is run, instead of updating newly found data only
    By Lostinxcel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-10-2010, 03:41 AM
  7. Replies: 0
    Last Post: 12-05-2008, 01:32 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