Consulting

Results 1 to 2 of 2

Thread: How to run external software run multiple files after each other using VBA (in Excel)

  1. #1

    How to run external software run multiple files after each other using VBA (in Excel)

    Hi all,

    I am not very experienced with VBA and I have a question about accessing files from software using Excel.
    I have multiple files with need to be executed. Every file takes about a day to complete. However, in the weekend this means that part of the weekend is not used, as only one file can be executed at a time.
    To run the multiple files, I have to select the file manually in the software and execute it by clicking the run button or hit F9.

    Is there a way to run multiple files after each other using VBA from within Excel? Excel could list the files in a folder which need to run in series. I know how to open a single file but not how to run them in series and check whether every file has been successfully finished. Also, when hitting the run button/F9, there might be a 'warning' message box, for which the user needs to click 'ok'. I know this can be done with SENDKEYS but I have no idea how this works. The message box needs to have focus etc.

    Path = "C:\Test1.otx"
    
    CreateObject("Shell.Application").Open (Path)
    Can anybody help me with this?

    Regards,
    Martin

  2. #2
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,728
    Location
    This might help

    http://www.vbaexpress.com/forum/show...bit-and-64-bit


    Personally, though, if I was running a series of programs, I'd use a VBScript (.VBS) file and not VBA. I don't know PowerShell, but VBS is like a batch file on steroids

    If you have access to the runned programs code, you could probably tweak it a bit to be more unattended-run friendly
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

Tags for this Thread

Posting Permissions

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