+ Reply to Thread
Results 1 to 3 of 3

A problem implementing a delay within a for-each loop

  1. #1
    Registered User
    Join Date
    04-18-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    40

    A problem implementing a delay within a for-each loop

    Hello everyone,

    I have a small problem that I hope someone may be able to shine some light on for me

    I'm trying to automate a process to download some financial data from a well known provider and I've managed to knock up a workbook that does this ok. (named Fully Working Worksheet.xls in the code below)

    There are a number of data series (tickers) that I want to download and I have stored these in a range in my 'main' spreadsheet that the code below refers to.

    When I pass the name of my data series into the workbook that downloads the data from the provider, this process can take some time, so I have tried to implement a short delay using the application.wait method so that the 'slave' spreadsheet has time to finish downloading the data. This doesn't seem to work however as it seems that the downloading process doesn't work when the procedure below is 'tied up' in the application.wait method.

    Please Login or Register  to view this content.
    I'm not entirely sure if the approach I've selected is doable, therefore would I'd be most grateful if anyone might be able to suggest a solution to the above problem.

    Many Thanks in advance,
    Twills

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: A problem implementing a delay within a for-each loop

    See Help for the OnTime method. Basically, you want to schedule a 'resume' macro to run after a few seconds, and the just exit the current sub. Then you're not suspending Excel.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    04-18-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    40

    Re: A problem implementing a delay within a for-each loop

    Thanks, shg,

    I'll give this a go....

    Regards,
    Twills

+ 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