Generating a msg box using VB code?

W

WSH

Is there a way to generate a warning/msg box when a task is delayed or missed
a deadline date? Something along those lines anyways.

Perhaps writing my own VB code into it? I know there isnt a simple way to do
it on MS Project.

Thank you ever so much for everyone thats helped me!
 
J

Jan De Messemaeker

Hi,

There is a simple way to write VBA code in Project.
Alt+F11 opens the VB Editor
Insert, Module lets you start programming

Use this sequence:

For each tsk in activeproject.tasks
if not tsk is nothing then
'Empty lines generate a nothing object as task which cannot be addressed
...... whatever treatment
end if
next tsk

HTH
 
W

WSH

Thanks Jan,

This sounds cheeky of me but do you have the full code for it? I'm not very
good at coding with VB. I've only touched on it.
 
J

Jan De Messemaeker

Hi,

You will have to specify what you want
"Delayed or missed a deadline or something along those lines" is hardly a
specific requirement for code :)
If it's clear and feasible I can give you some code

HTH
 
W

WSH

OK:

Let's say I have inserted a deadline date for a task but for some reason I
forgot about it. So I move that task to finish after the deadline date. I
want a Messege box to pop up and tell me that 'You cannot move this task to
finish later because the deadline date is......'

Hope that is specific enough. Thank you :)
 
J

Jan De Messemaeker

Hi,

This is only possible using event-driven macros and it's such a long time I
haven't used this that I hesitate to invest the time to study and write it
especially as in this case there is an immediate warning in the indicators
column.
Don't forget that moving a task (that I NEVER did for real, just tried it to
show it in courses) can cause an other task (linked to the first one) to
miss the deadline.
And when you set a constraint such as finish no later than the message box
is there builtin..

You could re-post, I'll then refrain from answering, maybe somebody more
aware than I on event-driven macro's will answer...
Sorry I have taken some of your time needlessly!
 
J

JackD

Hmmm... I'm with Jan on this. There are already indicators for this. I
suggest that you train users to look at them instead of writing code to
remind them. You probably shouldn't be moving tasks anyway. The dependencies
which require them to occur at a certain point should be sufficient to move
them as necessary. Also, moving one task may affect another down the line.
Writing code to detect those changes and warn about them would be painful.
 
W

WSH

JackD, Jan,

Thanks for the feedback and taking time to reply back. Yes I will use the
indicators instead of the warning box.

Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top