+ Reply to Thread
Results 1 to 3 of 3

Refreshing Web Query Problem

  1. #1
    andym
    Guest

    Refreshing Web Query Problem

    Dear All,

    this seems like a common problem, but I have not seen a definiate
    solution yet - so any help would be most appreciated.

    I have some code that does a vlookup where the source data is via a web
    query. Occassionally I need to refresh the web query to update the
    data.

    However, it appears that the code completes before the page is
    refreshed, so the old data is still used in the vlookup.

    When I manually step through the process (F8) it completes perfectly as
    I presume the extra time I take enables the web query to refresh in
    time.

    Any ideas how I can ensure that the refreshing is completed before the
    remainder of the code is finalised?

    Regards,

    andym


  2. #2
    Don Guillett
    Guest

    Re: Refreshing Web Query Problem

    try
    application.enableevents=false
    code
    application.enableevents=true

    --
    Don Guillett
    SalesAid Software
    dguillett1@austin.rr.com
    "andym" <apmeehan@gmail.com> wrote in message
    news:1134903026.984777.199960@f14g2000cwb.googlegroups.com...
    > Dear All,
    >
    > this seems like a common problem, but I have not seen a definiate
    > solution yet - so any help would be most appreciated.
    >
    > I have some code that does a vlookup where the source data is via a web
    > query. Occassionally I need to refresh the web query to update the
    > data.
    >
    > However, it appears that the code completes before the page is
    > refreshed, so the old data is still used in the vlookup.
    >
    > When I manually step through the process (F8) it completes perfectly as
    > I presume the extra time I take enables the web query to refresh in
    > time.
    >
    > Any ideas how I can ensure that the refreshing is completed before the
    > remainder of the code is finalised?
    >
    > Regards,
    >
    > andym
    >




  3. #3
    K Dales
    Guest

    RE: Refreshing Web Query Problem

    Make sure the QueryTable.BackgroundQuery property is set to False. Can be
    done wither in code or by right-clicking on the querytable result range and
    choosing Properties. Background queries allow other processing to occur
    before the results are returned.

    --
    - K Dales


    "andym" wrote:

    > Dear All,
    >
    > this seems like a common problem, but I have not seen a definiate
    > solution yet - so any help would be most appreciated.
    >
    > I have some code that does a vlookup where the source data is via a web
    > query. Occassionally I need to refresh the web query to update the
    > data.
    >
    > However, it appears that the code completes before the page is
    > refreshed, so the old data is still used in the vlookup.
    >
    > When I manually step through the process (F8) it completes perfectly as
    > I presume the extra time I take enables the web query to refresh in
    > time.
    >
    > Any ideas how I can ensure that the refreshing is completed before the
    > remainder of the code is finalised?
    >
    > Regards,
    >
    > andym
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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