Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 548
  • Last Modified:

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

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.  
  • 3
  • 3
1 Solution
Jeffrey CoachmanCommented:

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.

MasterandCommanderAuthor Commented:

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!
Jeffrey CoachmanCommented:

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.

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

MasterandCommanderAuthor Commented:

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.
Jeffrey CoachmanCommented:
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.

MasterandCommanderAuthor Commented:
Works.  Will use that and work from there...

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now