Displaying holidays in the Gantt chart

Discussion in 'Project General' started by Candido Rodriguez, Jun 15, 2004.

  1. MSP takes care of the holidays of a resource when drawing
    the bar in the GANT chart.
    Is it possible to see the bar in a way holidays are
    displayed differently than working days ?
    Thanks for you answer.

    C@ndido
     
    Candido Rodriguez, Jun 15, 2004
    #1
    1. Advertising

  2. Hi Candido,

    Nice to hear from you again - starting to be a user hey
    I have an article on this on my website
    HTH

    --
    Jan De Messemaeker
    Microsoft Project Most Valuable Professional
    http://users.online.be/prom-ade/index.htm
    32-495-300 620
    "Candido Rodriguez" <> schreef in bericht
    news:1c9ca01c452c2$5fb92a00$...
    > MSP takes care of the holidays of a resource when drawing
    > the bar in the GANT chart.
    > Is it possible to see the bar in a way holidays are
    > displayed differently than working days ?
    > Thanks for you answer.
    >
    > C@ndido
    >
     
    Jan De Messemaeker, Jun 15, 2004
    #2
    1. Advertising

  3. Yes indeed I try go deeper in the product and I suppose
    the problem I am facing with is not new.
    I found a VB script that works fine. It creates a new
    project and present the holidays per ressource as tasks.
    this is enough for me at the moment but I would like to
    see it in the same Gantt chart
    Thanks anyway, I will go and visit your site.
    For those who are interessed I post here beneath the code
    I found (the code has been written by Michael Magan,
    thanks to him).
    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

    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
    DCalStart = PrjSrc.ProjectStart
    DCalEnd = PrjSrc.ProjectFinish + 90

    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

    C@ndido

    >-----Original Message-----
    >Hi Candido,
    >
    >Nice to hear from you again - starting to be a user hey
    >I have an article on this on my website
    >HTH
    >
    >--
    >Jan De Messemaeker
    >Microsoft Project Most Valuable Professional
    >http://users.online.be/prom-ade/index.htm
    >32-495-300 620
    >"Candido Rodriguez" <>

    schreef in bericht
    >news:1c9ca01c452c2$5fb92a00$...
    >> MSP takes care of the holidays of a resource when

    drawing
    >> the bar in the GANT chart.
    >> Is it possible to see the bar in a way holidays are
    >> displayed differently than working days ?
    >> Thanks for you answer.
    >>
    >> C@ndido
    >>

    >
    >
    >
    >.
    >
     
    candido Rodriguez, Jun 16, 2004
    #3
  4. Hi,
    There is a macro on my website as well; it groups consecutive holidays into
    one task.
    HTH

    --
    Jan De Messemaeker
    Microsoft Project Most Valuable Professional
    http://users.online.be/prom-ade/index.htm
    32-495-300 620
    "candido Rodriguez" <> schreef in bericht
    news:1d4ce01c4537d$65498170$...
    > Yes indeed I try go deeper in the product and I suppose
    > the problem I am facing with is not new.
    > I found a VB script that works fine. It creates a new
    > project and present the holidays per ressource as tasks.
    > this is enough for me at the moment but I would like to
    > see it in the same Gantt chart
    > Thanks anyway, I will go and visit your site.
    > For those who are interessed I post here beneath the code
    > I found (the code has been written by Michael Magan,
    > thanks to him).
    > 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
    >
    > 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
    > DCalStart = PrjSrc.ProjectStart
    > DCalEnd = PrjSrc.ProjectFinish + 90
    >
    > 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
    >
    > C@ndido
    >
    > >-----Original Message-----
    > >Hi Candido,
    > >
    > >Nice to hear from you again - starting to be a user hey
    > >I have an article on this on my website
    > >HTH
    > >
    > >--
    > >Jan De Messemaeker
    > >Microsoft Project Most Valuable Professional
    > >http://users.online.be/prom-ade/index.htm
    > >32-495-300 620
    > >"Candido Rodriguez" <>

    > schreef in bericht
    > >news:1c9ca01c452c2$5fb92a00$...
    > >> MSP takes care of the holidays of a resource when

    > drawing
    > >> the bar in the GANT chart.
    > >> Is it possible to see the bar in a way holidays are
    > >> displayed differently than working days ?
    > >> Thanks for you answer.
    > >>
    > >> C@ndido
    > >>

    > >
    > >
    > >
    > >.
    > >
     
    Jan De Messemaeker, Jun 16, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Project Slave
    Replies:
    2
    Views:
    228
    JulieD
    Mar 10, 2005
  2. Vit
    Replies:
    1
    Views:
    192
    Dale Howard [MVP]
    May 21, 2008
  3. Guest
    Replies:
    1
    Views:
    174
    Jan De Messemaeker
    Jul 2, 2009
  4. Joe

    Enterprise Gantt Chart vs. Gantt Chart

    Joe, Dec 14, 2004, in forum: Project Server
    Replies:
    1
    Views:
    400
    Dale Howard [MVP]
    Dec 14, 2004
  5. Paul

    Gantt chart: Designating holidays

    Paul, Jun 9, 2008, in forum: Visio General
    Replies:
    1
    Views:
    128
Loading...

Share This Page