Vacation Macros 
Author Message
 Vacation Macros

Does anybody have a vacation macros that enables me to
represent resource holidays as gantt bars on the gantt
chart

If so this would be much appreciated as i have gone as far
as i can with Project 2002 and this is my only problem

Regards

C Palmer



Tue, 29 Nov 2005 17:57:08 GMT  
 Vacation Macros

Quote:

> Does anybody have a vacation macros that enables me to
> represent resource holidays as gantt bars on the gantt
> chart

> If so this would be much appreciated as i have gone as far
> as i can with Project 2002 and this is my only problem

> Regards

> C Palmer

I don't have one. Mainly because it is not very useful. What do you gain by
doing this? How would you update them when things change? Would you link
them to the other tasks (no - because then they would move if a predecessor
is changed)? And if they aren't linked then any task which spans the
vacation will still show as continuing through that period anyway. So given
that, you could do something, but I fear its usefulness would be very small.

I think it is something that you will have to try and live without.

--
Please try to keep replies in this group. I do check e-mail, but only
infrequently. For Macros and other things check http://masamiki.com/project

-Jack Dahlgren, Project MVP

+++++++++++++++++++



Wed, 30 Nov 2005 04:25:47 GMT  
 Vacation Macros

Quote:


>>Does anybody have a vacation macros that enables me to
>>represent resource holidays as gantt bars on the gantt
>>chart

>>If so this would be much appreciated as i have gone as far
>>as i can with Project 2002 and this is my only problem

>>Regards

>>C Palmer

> I don't have one. Mainly because it is not very useful. What do you gain by
> doing this? How would you update them when things change? Would you link
> them to the other tasks (no - because then they would move if a predecessor
> is changed)? And if they aren't linked then any task which spans the
> vacation will still show as continuing through that period anyway. So given
> that, you could do something, but I fear its usefulness would be very small.

> I think it is something that you will have to try and live without.

I agree fully with Jack's points.  It also occurs to me to wonder what
your intended purpose is.  If the intention is to have a Gantt chart
view of everyone's vacation and holidays (after all, it's now June and
time to look forward to vacation!), use a completely separate Project
file to represent each person's vacation plans as a separate task.  Post
this on your web site or bulletin board to publish vacation.


Wed, 30 Nov 2005 14:59:30 GMT  
 Vacation Macros
Hello Folks,

Curious, because I have one (but it is embedded in a procedure with several
hundreds of statements paid for by my customer...)

There are several advantages to doing this:

- You can visualize vacation on Gantt Charts
- What's more, when consolidation Work, you will see everybody 100% at work
and top management doesn't have to wonder why somebody is only working for
10 days in September for instance.

It is something several customers have asked for.

You go about by looping through the resources' and the project calendar day
by day and check the period.working property; when different, and the
previous day was busy as well, stretch the task, if not create a new one...

Hope this helps,

--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
Project Management Consultancy
Prom+ade BVBA
32-495-300 620


Quote:

> > Does anybody have a vacation macros that enables me to
> > represent resource holidays as gantt bars on the gantt
> > chart

> > If so this would be much appreciated as i have gone as far
> > as i can with Project 2002 and this is my only problem

> > Regards

> > C Palmer

> I don't have one. Mainly because it is not very useful. What do you gain
by
> doing this? How would you update them when things change? Would you link
> them to the other tasks (no - because then they would move if a
predecessor
> is changed)? And if they aren't linked then any task which spans the
> vacation will still show as continuing through that period anyway. So
given
> that, you could do something, but I fear its usefulness would be very
small.

> I think it is something that you will have to try and live without.

> --
> Please try to keep replies in this group. I do check e-mail, but only
> infrequently. For Macros and other things check

http://masamiki.com/project

- Show quoted text -

Quote:

> -Jack Dahlgren, Project MVP

> +++++++++++++++++++



Wed, 30 Nov 2005 15:22:41 GMT  
 Vacation Macros
Quote:

> Hello Folks,

> Curious, because I have one (but it is embedded in a procedure with several
> hundreds of statements paid for by my customer...)

> There are several advantages to doing this:

[snip]

Jan,

Agree it's useful to visualize vacation time like this. I wish I had a
macro to do it because without it's very complex.  Without the macro the
simple alternative is to completely separate bar-chart representations
of vacations and "eye-ball" this with the project's Gantt chart.

Your macro sounds terrific ... I can see the power in visualising
vacation time along with project tasks.   Heck any good visualisation is
extremely valuable.   We ought find a way to make someting like this
available.

Speaking of visualisation (OT, I know), but have you ever run across the
ongoing/long-term discussion on Edward Tufte's web site on the topic of
"Project Management Graphics" at
http://www.edwardtufte.com/1536836774/bboard/q-and-a-fetch-msg?usca_p....
Fascinating reading.

rms



Wed, 30 Nov 2005 16:05:22 GMT  
 Vacation Macros
I also found it useful to visualize the holidays. Here is the macro that
does the job. Enjoy.

-- Michael Magan (at oracle.com)

Sub HolidayGantt()
' Creates a new project, with a task for each resource
' The task bar shows the holidays for each resource
' The range for the calendar is from project start to 3 months beyond
' the project finish
' For the visual effect, we put a block at the start and the end of the bar
' 14-Jun-2001  Michael Magan
' 22-Aug-2002  Bugfix: If the dummy-holiday at the start and end was a
'              non-working day, this resulted in a runtime error. The
'              fix is to use ActualWork instead of Work.
' 14-Apr-2003  It turns out that you cannot assign actual work to a task
'              on a non-working day, only to an assignment. So the fix is
'              to move the start- and end markers to the next working day.

   Dim PrjSrc As Project    ' Source project
   Dim PrjDest As Project   ' New (destination) project
   Dim T As Task
   Dim D As Date
   Dim DCalStart As Date
   Dim DCalEnd As Date

   Set PrjSrc = ActiveProject

   FileNew
   Set PrjDest = ActiveProject
   PrjDest.ProjectStart = PrjSrc.ProjectStart

   ' Set the date range for the holiday calendar
   ' Advance the end date to the next working day
   DCalStart = PrjSrc.ProjectStart
   DCalEnd = PrjSrc.ProjectFinish + 90
   While Not PrjSrc.BaseCalendars(1).Period(DCalEnd, DCalEnd).Working
     DCalEnd = DCalEnd + 1
   Wend

   For Each R In PrjSrc.Resources
     Set T = PrjDest.Tasks.Add(Name:=R.Name)

     ' Set a dummy holiday at the start and end of the calendar
     ' This creates a dotted line for the duration of this task
     T.TimeScaleData(DCalStart _
                   , DCalStart + 1 _
                   , pjTaskTimescaledWork _
                   , pjTimescaleDays)(1).Value = 8 * 60
     T.TimeScaleData(DCalEnd _
                   , DCalEnd + 1 _
                   , pjTaskTimescaledWork _
                   , pjTimescaleDays)(1).Value = 8 * 60

     ' For each day of the project, compare the resource calendar
     ' with the standard calendar. If the standard calendar has
     ' a working day, and the resource calendar does not, then it
     ' is a holiday
     For D = DCalStart To DCalEnd
       If PrjSrc.BaseCalendars(1).Period(D, D).Working And Not _
                       R.Calendar.Period(D, D).Working Then
         T.TimeScaleData(D _
                       , D + 1 _
                       , pjTaskTimescaledWork _
                       , pjTimescaleDays)(1).Value = 8 * 60
       End If
     Next D
   Next R
End Sub



Sat, 03 Dec 2005 23:23:35 GMT  
 Vacation Macros
Thanks for the contribution!


Sat, 03 Dec 2005 23:34:37 GMT  
 Vacation Macros
Nice Job, Michael.

Can I add a tiny little extra?
If your calendar options have a number of hours per day different from 8
Replace 8 * by PrjSrc.HoursPerDay

HTH

--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
Project Management Consultancy
Prom+ade BVBA
32-495-300 620


Quote:
> I also found it useful to visualize the holidays. Here is the macro that
> does the job. Enjoy.

> -- Michael Magan (at oracle.com)

> Sub HolidayGantt()
> ' Creates a new project, with a task for each resource
> ' The task bar shows the holidays for each resource
> ' The range for the calendar is from project start to 3 months beyond
> ' the project finish
> ' For the visual effect, we put a block at the start and the end of the
bar
> ' 14-Jun-2001  Michael Magan
> ' 22-Aug-2002  Bugfix: If the dummy-holiday at the start and end was a
> '              non-working day, this resulted in a runtime error. The
> '              fix is to use ActualWork instead of Work.
> ' 14-Apr-2003  It turns out that you cannot assign actual work to a task
> '              on a non-working day, only to an assignment. So the fix is
> '              to move the start- and end markers to the next working day.

>    Dim PrjSrc As Project    ' Source project
>    Dim PrjDest As Project   ' New (destination) project
>    Dim T As Task
>    Dim D As Date
>    Dim DCalStart As Date
>    Dim DCalEnd As Date

>    Set PrjSrc = ActiveProject

>    FileNew
>    Set PrjDest = ActiveProject
>    PrjDest.ProjectStart = PrjSrc.ProjectStart

>    ' Set the date range for the holiday calendar
>    ' Advance the end date to the next working day
>    DCalStart = PrjSrc.ProjectStart
>    DCalEnd = PrjSrc.ProjectFinish + 90
>    While Not PrjSrc.BaseCalendars(1).Period(DCalEnd, DCalEnd).Working
>      DCalEnd = DCalEnd + 1
>    Wend

>    For Each R In PrjSrc.Resources
>      Set T = PrjDest.Tasks.Add(Name:=R.Name)

>      ' Set a dummy holiday at the start and end of the calendar
>      ' This creates a dotted line for the duration of this task
>      T.TimeScaleData(DCalStart _
>                    , DCalStart + 1 _
>                    , pjTaskTimescaledWork _
>                    , pjTimescaleDays)(1).Value = 8 * 60
>      T.TimeScaleData(DCalEnd _
>                    , DCalEnd + 1 _
>                    , pjTaskTimescaledWork _
>                    , pjTimescaleDays)(1).Value = 8 * 60

>      ' For each day of the project, compare the resource calendar
>      ' with the standard calendar. If the standard calendar has
>      ' a working day, and the resource calendar does not, then it
>      ' is a holiday
>      For D = DCalStart To DCalEnd
>        If PrjSrc.BaseCalendars(1).Period(D, D).Working And Not _
>                        R.Calendar.Period(D, D).Working Then
>          T.TimeScaleData(D _
>                        , D + 1 _
>                        , pjTaskTimescaledWork _
>                        , pjTimescaleDays)(1).Value = 8 * 60
>        End If
>      Next D
>    Next R
> End Sub



Sun, 04 Dec 2005 01:02:42 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Need a macros to produce vacation report

2. Your Vacation in SE Asia

3. Need Vacation, Need $$$$

4. Vacation Money

5. Mexico Beach House Vacation trade (or $$) for VBA-ADO cyber consulting

6. Tracking Employee Vacation Time in Outlook

7. TimeScaleData to check vacations in a resource calendar

8. will be on 3 weeks vacation

9. vacation ?

10. Vacations on Beautiful cape cod

11. DLL Experts on Vacation?

12. Global Const on vacation - what happened?

 

 
Powered by phpBB® Forum Software