Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How to start executables with VBA

Unknown Guest
I need to startup commandline utilities from a VBA program I'm writing. I need it to automate some system administration tasks.



Any other way to automate these tasks in VBA?






Comments

  • : I need to startup commandline utilities from a VBA program I'm writing. I need it to automate some system administration tasks.

    :

    : Any other way to automate these tasks in VBA?



    You can start executables in VBA by using the Shell command. Your code will continue running after starting the shell (there is no way to check if it has finished or not). If you want to wait till it has executed you will have to use another method which is more complex.



    Hope this helps. Greetings,

    Erwin




  • Thanks



    I will try this - I think I'll use some output to a file to determine if the executable has finished...



    About the other method: where can I find more about it?










  • : Thanks

    :

    : I will try this - I think I'll use some output to a file to determine if the executable has finished...

    :

    : About the other method: where can I find more about it?



    You can look in the MSDN library (search the knowledgebase for Q129796), it has an example there. If you don't have the MSDN library you can search in the MS knowledgebase on the internet for the same articlenumber.



    Good luck,

    Erwin




  • jaime777jaime777 Posts: 17Member
    Hi,

    Here is the code to open executables:

    Call Shell("winword.exe", vbMaximizedFocus)

    Hope this helps!

    -Jaime
    www.programmerssolutions.com
Sign In or Register to comment.