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. Advertisements

  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. Advertisements

  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. Advertisements

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 (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Mark

    Displaying Resource Initial in Gantt Chart

    Mark, May 6, 2004, in forum: Project General
    Replies:
    1
    Views:
    153
    Dale Howard [MVP]
    May 6, 2004
  2. Frank Hendriks
    Replies:
    1
    Views:
    550
    Haixiang
    Mar 8, 2005
  3. Project Slave
    Replies:
    2
    Views:
    587
    JulieD
    Mar 10, 2005
  4. Kimbo
    Replies:
    2
    Views:
    966
    Kimbo
    Aug 10, 2005
  5. Clive
    Replies:
    2
    Views:
    415
    JulieS
    Feb 17, 2006
  6. Aman Gandhi

    Doubts on displaying progress lines on gantt chart

    Aman Gandhi, Sep 28, 2007, in forum: Project General
    Replies:
    1
    Views:
    176
    Mike Glen
    Sep 28, 2007
  7. Vit
    Replies:
    1
    Views:
    561
    Dale Howard [MVP]
    May 21, 2008
  8. Guest
    Replies:
    1
    Views:
    427
    Jan De Messemaeker
    Jul 2, 2009
Loading...