How to start executables with VBA

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




  • 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.

Howdy, Stranger!

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

Categories

In this Discussion