+ Reply to Thread
Results 1 to 5 of 5

Know when .cmd has finished

  1. #1
    krayten
    Guest

    Know when .cmd has finished

    Hi folks,

    I have a little macros which at one point shells a .cmd file to run
    minimised, almost
    in the background as it were.

    Shell "C:\Hotfixer\customscan.cmd", 2

    The trouble is I don't want the user moving on into the next phase of
    event handling until that
    ..cmd has completed what it needed to do. The user could end up querying
    for data that the
    ..cmd hasn't yet returned.

    What I want to do is have a "please wait" then a "OK Data retrieved"
    kind of sequence
    which starts when the shell spawns and the finishes when the .cmd
    expires.

    I'd be very grateful indeed for any advice or sample code.

    I am very new to xlvba so the simpler it could be the better!!!

    Many thanks,

    ========
    Stuart


  2. #2
    Ron de Bruin
    Guest

    Re: Know when .cmd has finished

    Hi krayten

    You can use
    ShellAndWait

    You cand find the code and see how you can use it here
    http://www.rondebruin.nl/zip.htm


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "krayten" <[email protected]> wrote in message news:[email protected]...
    > Hi folks,
    >
    > I have a little macros which at one point shells a .cmd file to run
    > minimised, almost
    > in the background as it were.
    >
    > Shell "C:\Hotfixer\customscan.cmd", 2
    >
    > The trouble is I don't want the user moving on into the next phase of
    > event handling until that
    > .cmd has completed what it needed to do. The user could end up querying
    > for data that the
    > .cmd hasn't yet returned.
    >
    > What I want to do is have a "please wait" then a "OK Data retrieved"
    > kind of sequence
    > which starts when the shell spawns and the finishes when the .cmd
    > expires.
    >
    > I'd be very grateful indeed for any advice or sample code.
    >
    > I am very new to xlvba so the simpler it could be the better!!!
    >
    > Many thanks,
    >
    > ========
    > Stuart
    >




  3. #3
    Dave Peterson
    Guest

    Re: Know when .cmd has finished

    If you're lucky and you know that your .cmd file always takes less than x
    seconds, you could add application.wait (x + 30% seconds)
    (or whatever you feel comfortable with.)

    But there are other ways.

    http://support.microsoft.com/?kbid=214248
    XL2000: How to Force Macro Code to Wait for Outside Procedure
    or

    Here's a link to a nice ShellAndWait function that does that.
    http://groups.google.com/groups?thre...%40tkmsftngp03

    krayten wrote:
    >
    > Hi folks,
    >
    > I have a little macros which at one point shells a .cmd file to run
    > minimised, almost
    > in the background as it were.
    >
    > Shell "C:\Hotfixer\customscan.cmd", 2
    >
    > The trouble is I don't want the user moving on into the next phase of
    > event handling until that
    > .cmd has completed what it needed to do. The user could end up querying
    > for data that the
    > .cmd hasn't yet returned.
    >
    > What I want to do is have a "please wait" then a "OK Data retrieved"
    > kind of sequence
    > which starts when the shell spawns and the finishes when the .cmd
    > expires.
    >
    > I'd be very grateful indeed for any advice or sample code.
    >
    > I am very new to xlvba so the simpler it could be the better!!!
    >
    > Many thanks,
    >
    > ========
    > Stuart


    --

    Dave Peterson

  4. #4
    krayten
    Guest

    Re: Know when .cmd has finished

    Super, sounds like exactly what i need - thank you!


  5. #5
    krayten
    Guest

    Re: Know when .cmd has finished

    Dave,

    That's ideal. I'll check out all these suggestions.
    Thanks for the superswift response!!

    Best regards,

    Stuart


+ 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