Project 2003 - VBA or macro code: Task date triggers the opening of an external .exe file

Posted on 2008-11-03
Last Modified: 2013-11-27
I have a Ms Project file and to track some Tasks.  I would like to have that file open (every day) and if there is a Task that should START today, it will trigger a file called Task.exe that is on C:\

How could this be done (programatically)?

1. Every morning I open Ms Project File "MyBigProject"
2. On Open the .mpp file checks Task Start dates and compares to Today
3. Every specific task has an .exe file associated with THAT particular task, ex.  Task 1 has an Task1.exe file lying on C:\TaskFolder
(What these do is to go and collect information from other file systems or databases and put them in a certain order - I scripted them becasue they are recurring and associated with this project).
4. If i have on one day Task 3, Task4 and Task5 the corresponding .exe´s fire up (Task3.exe, Task4.exe, Task5.exe)

How could this be programmed in VBA code? (only complete code will get the points).

Alternatively: I could setup the tasks in Outlook Calendar and every day open up Outlook and have Outlook go into the folder and trigger the exe´s, but maybe this is more difficult since I have to tinker with the Exchange Server, which I do not have access to.

Thanks for your help.  
Question by:MasterandCommander
    LVL 74

    Expert Comment

    by:Jeffrey Coachman

    Just a note:

       "(only complete code will get the points)."

    Statements like this tend to deter experts, rather than attract them.
    There are hundreds of 500 point questions here *without* this restriction, so it is easier to pass on your question for a less "restrictive" question.

    No one wants to take a chance on posting 90% fully working code, only to have you reject it because it is not what you consider 100% "Complete Code".

    Again, just FYI.


    Author Comment


    Hi Jeff,

    you´re right..... i guess I wasn´t thinking :-)

    I fully appreciate any help I can get from the good folks around here.....

    So, again to anyone of you interested in helping me out: How can I programatically execute an application, from within VBA code?  Even if we don´t get the "checking dates"-thingy functioning, i would like to open a program autoamitcally with vba code (i could execute the function manually....)

    Greetings.  Thanks again Jeff for your observation!
    LVL 74

    Accepted Solution


    You can open almost any application directly by using the "Shell" comand.

    For example, this will open Adobe Acrobat PDF Reader:
        Dim stAppName As String

        stAppName = "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe"
        Call Shell(stAppName, 1)

    Now if you are talking about opening a program like MS Project and actually manipulating the program in code, this requires a different approach.


    Author Comment


    No, i just want to attach VBA code to some MS Project and include a link or something that opens a different program, other than MS Project.  It will open support software to the project i have.

    Thanks Jeff.
    LVL 74

    Expert Comment

    by:Jeffrey Coachman
    That is what my code will do.

    You would run this from MS Project and it will open almost any "support software" that you need.


    Author Comment

    Works.  Will use that and work from there...

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Learn more about the importance of email disclaimers with our top 10 email disclaimer DOs and DON’Ts.
    Use email signature images to promote corporate certifications and industry awards.
    This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now