Results 1 to 8 of 8

Thread: Function to wait until a particular file exists

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,776
    Perhaps something like:

    Function WaitForFile(filePathAndName As String, timeOutSeconds As Long) As Boolean
        Dim Begin As Long
        Begin = Timer
        On Error Resume Next
        Workbooks.Open filePathAndName
        WaitForFile = ((CLng(Timer) - CLng(Begin)) < timeOutSeconds) And (Err = 0)
        On Error GoTo 0
    End Function
    Last edited by Aussiebear; 07-08-2024 at 03:01 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •