Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2002
    Posts
    108

    Post Unanswered: Pausing VBA code until external program finishes execution

    I have code that processes data exported from another program.

    My Access code initiates the external program, but continues it's own code even before the ext program finishes exporting the data that Access is trying to process with the remaining code.

    Any way to make Access see if the other program is still running ?

  2. #2
    Join Date
    Oct 2003
    Posts
    706

    Arrow

    You need to show us a small excerpt from your code, showing us how you initiate the external program. There are, indeed, ways to start a program and wait for its completion. But until we know what you've tried ...
    ChimneySweep(R): fast, automatic
    table repair at a click of the
    mouse! http://www.sundialservices.com

  3. #3
    Join Date
    Oct 2003
    Location
    US
    Posts
    343

    Re: Pausing VBA code until external program finishes execution

    Try DoEvents () function .


    Originally posted by jkevin
    I have code that processes data exported from another program.

    My Access code initiates the external program, but continues it's own code even before the ext program finishes exporting the data that Access is trying to process with the remaining code.

    Any way to make Access see if the other program is still running ?

  4. #4
    Join Date
    Feb 2002
    Posts
    108
    'next line starts street map program
    Call Shell("C:\Program Files\Microsoft Streets and Trips\Streets.exe", 1)


    ' this is where I need to wait, when maps program is started then we can proceed, but depending on what else is running on computer, this sometimes takes longer, so a timer doesn't work well
    I have also tried the doevents function and also the DBEngine.Idle dbRefreshCache



    ' next line sends keystokes to other program
    ' mysendkeys is a module being used
    MySendKeys [PhysicalAddress] & ", " & [PhysicalCity] & ", sc{enter}"



    Originally posted by sundialsvcs
    You need to show us a small excerpt from your code, showing us how you initiate the external program. There are, indeed, ways to start a program and wait for its completion. But until we know what you've tried ...

Posting Permissions

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