+ Reply to Thread
Results 1 to 2 of 2

Run Macro After SQL Query Refresh

  1. #1
    Forum Contributor
    Join Date
    02-25-2010
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2010
    Posts
    138

    Run Macro After SQL Query Refresh

    Morning All,

    I am looking for a way to be able to refresh a pivot table after my SQL Query has refreshed.

    I tried to record a macro of a manual refresh on both tables, but the PivotTable refresh happens too quickly, so the SQL Server hasn't refreshed.

    Any help would be greatly appreciated.

    Many Thanks
    Ross

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,980

    Re: Run Macro After SQL Query Refresh

    If you turn off the background query option for the connection, it should allow your code to refresh the query, then the pivot table in the correct order.
    Everyone who confuses correlation and causation ends up dead.

+ 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. Macro won't fire on sheet change with query refresh
    By JJGF in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-21-2013, 11:42 PM
  2. Replies: 2
    Last Post: 09-29-2013, 06:15 AM
  3. Replies: 1
    Last Post: 09-28-2013, 07:11 PM
  4. Replies: 1
    Last Post: 09-25-2012, 01:30 AM
  5. Macro to Refresh Database Query
    By gatorator in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-28-2011, 08:37 AM
  6. Macro to refresh query.
    By CJPHX in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-20-2010, 01:47 PM
  7. Macro to Refresh Import Query
    By erock24 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-02-2009, 03:57 AM
  8. User-ID & PSWD from Macro for a Query Refresh
    By ldevrries in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-31-2007, 12:21 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