+ Reply to Thread
Results 1 to 7 of 7

Alternative to Application.Wait vba

  1. #1
    Forum Contributor
    Join Date
    05-13-2009
    Location
    Manila philippines
    MS-Off Ver
    Excel 2010
    Posts
    113

    Alternative to Application.Wait vba

    Hello,

    I have a code that downloads files by looping into a listed links. The sequence of downloading the files is very important(the codes download the file based on the arrangement of the list) and the there were instances that a file is not downloaded on time becuase of its size or the slowness of the connection. Hence, I have to rerun the code to start over again. To address this, I included Application.wait to 10 seconds before it download the next file. But there be an alternative code that would wait for the file to completw to be downloaded first before downloading the next file? Thanks

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,025

    Re: Alternative to Application.Wait vba

    Maybe use Dir to test if the file exists. Only continue when it does (but use a large loop counter so that it doesn't wait forever)
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,471

    Re: Alternative to Application.Wait vba

    .
    I suspect you are using the following, which is what I use here :

    Please Login or Register  to view this content.
    Works very well.

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Alternative to Application.Wait vba

    Can’t you use doevents in a loop whilst checking for the file as Trevor suggests?

  5. #5
    Forum Contributor
    Join Date
    05-13-2009
    Location
    Manila philippines
    MS-Off Ver
    Excel 2010
    Posts
    113
    Quote Originally Posted by Logit View Post
    .
    I suspect you are using the following, which is what I use here :

    Please Login or Register  to view this content.
    Works very well.
    Yes this is what i use and works well. I set it to 10 sec to ensure it doesnt skip any files. However, takes a lot of time to compelete the downloads especially im downloading 50+ files.

  6. #6
    Forum Contributor
    Join Date
    05-13-2009
    Location
    Manila philippines
    MS-Off Ver
    Excel 2010
    Posts
    113
    Quote Originally Posted by Kyle123 View Post
    Can’t you use doevents in a loop whilst checking for the file as Trevor suggests?
    I rely on the sequence of of downloading because I don't know the filenames of each file. The link itself doenst give you the filename. When the file is downloaded, it gives me a ranfom filename. Completing all the download,I also run another code to rename the filenames based on the list as well.

  7. #7
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Alternative to Application.Wait vba

    I think we need to see some code, please post what you are using

+ 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] Help with Application.OnTime (was Application.Wait Now)
    By Walter12 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-29-2012, 01:18 PM
  2. Sending e-mail - Alternative to SendKeys and Wait?
    By Phil_V in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-19-2011, 07:05 PM
  3. Wait if application open
    By astrikor in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-16-2010, 01:27 PM
  4. Application.wait error
    By SomeGuyInDC in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-26-2007, 01:44 PM
  5. Please help with Application.Wait ( )
    By Steve in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-07-2006, 04:10 AM
  6. Different syntax for Application.Wait
    By Desert Piranha in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-16-2005, 08:15 AM
  7. application.wait help
    By flowtester in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-04-2005, 11:55 AM
  8. Application.wait... won't!
    By Peter Rooney in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-08-2005, 11:05 AM

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