+ Reply to Thread
Results 1 to 8 of 8

Wait until Refresh is done

  1. #1
    Registered User
    Join Date
    05-30-2015
    Location
    SVK
    MS-Off Ver
    2016
    Posts
    38

    Wait until Refresh is done

    Hi, I use ListObject.QueryTable property to get external data. Driver ODBC, BackgroundQuery = False.

    I have some lines of code after QueryTable.Refresh, that are executed even the Query has not stopped running yet.
    I'd like them to wait until the Refresh is done.

    I tried to switch BackgroundQuery to True, Application.Wait, also a DoEvents method, but these don't do the trick.

  2. #2
    Registered User
    Join Date
    12-26-2015
    Location
    Paulding
    MS-Off Ver
    2007
    Posts
    3

    Re: Wait until Refresh is done

    Try this

    Application.ScreenUpdating = False

    If it works make sure to re-enable it when done.

  3. #3
    Registered User
    Join Date
    01-11-2013
    Location
    Indonesia
    MS-Off Ver
    excel 2013 n excel 2007
    Posts
    1

    Re: Wait until Refresh is done

    Quote Originally Posted by DouglasLL View Post
    Try this

    Application.ScreenUpdating = False

    If it works make sure to re-enable it when done.
    this work for me.. thx

  4. #4
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Wait until Refresh is done

    You can use this if you need to specify a peroid
    Please Login or Register  to view this content.
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  5. #5
    Registered User
    Join Date
    12-26-2015
    Location
    Paulding
    MS-Off Ver
    2007
    Posts
    3

    Re: Wait until Refresh is done

    yw - it's really good for large sheets, graphics, and conditional formatting that takes a long time.

  6. #6
    Registered User
    Join Date
    05-30-2015
    Location
    SVK
    MS-Off Ver
    2016
    Posts
    38

    Re: Wait until Refresh is done

    Thanks guys for your replies. Actually, neither
    Please Login or Register  to view this content.
    nor
    Please Login or Register  to view this content.
    do the desired effect.
    Let's say I have a query that pulls data from external database. After the Refresh command I have line that activates different sheet, another line that let's say fires a Message Box. Both these lines proceed even the comment "Refreshing" is still indicated on status bar/

    I have recently tried:
    Please Login or Register  to view this content.
    and it looks promising, meaning it takes longer to fire that msgbox but Refreshing process is not displayed on status bar anymore. Can someone please clarify me this application property?
    The excel help system is not very explanatory to my opinion.

  7. #7
    Forum Contributor
    Join Date
    09-03-2015
    Location
    IE
    MS-Off Ver
    2003 - 2016
    Posts
    258

    Re: Wait until Refresh is done


  8. #8
    Registered User
    Join Date
    05-30-2015
    Location
    SVK
    MS-Off Ver
    2016
    Posts
    38

    Re: Wait until Refresh is done

    Thanks for my missing reference grimes.
    Any idea on explaining the above Application method ?

+ 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. Wait Until Internal Refresh by Website is Complete
    By Jimbo77 in forum Excel Programming / VBA / Macros
    Replies: 26
    Last Post: 11-21-2017, 03:33 AM
  2. Does VBA wait until pivot completes refresh?
    By cornel.i in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-11-2016, 11:39 AM
  3. [SOLVED] Wait for update (refresh not working)
    By jik_ff in forum Access Tables & Databases
    Replies: 1
    Last Post: 07-18-2014, 10:33 AM
  4. Enable Auto Refresh - Wait for refresh to sinish before running a macro
    By tomlancaster in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-21-2011, 11:52 AM
  5. DataSource Refresh and wait
    By graeme86 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-23-2008, 09:11 AM
  6. Wait until MSQuery Refresh finished
    By ChrisR in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-19-2005, 01:05 PM
  7. Wait for Pivot Refresh to Complete
    By Dan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-14-2005, 02:05 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