Consulting

Results 1 to 2 of 2

Thread: Formatting Milestones

  1. #1
    VBAX Newbie
    Joined
    Mar 2015
    Posts
    3
    Location

    Formatting Milestones

    Hi,

    I've searched high and low and cannot find a solution to formatting Milestones. I can't even seem to find that there is a known issue with the method. I've tried recording the VBA and playing it back but I receive a 1101 - Argument is invalid message. The vba that is recorded is as follows.

    GanttBarFormatEx StartShape:=3, StartType:=0, StartColor:=255, MiddleShape:=0, MiddlePattern:=1, MiddleColor:=0, EndShape:=0, EndType:=0, EndColor:=0, RightText:="Task Finish"

    If I try and format a normal bar it works perfectly but the milestones just do not seem to take the method.

    I've supplied some sample code below that works when it is not a milestone (that bit is not supplied) but just does not work when it is a milestone. N.B. This is sample code that represents the type of thing I want to do, but I can't supply the full code so have written this little test harness.

    Does anyone have a solution for this?


    Sub markMilestone()

    Dim mTask As Task

    For Each mTask In ActiveProject.Tasks
    If mTask.Milestone = True Then
    GanttBarFormat TaskID:=mTask.ID, startshape:=pjStar, starttype:=pjSolid, _
    startcolor:=pjRed, middleshape:=pjNone, endshape:=pjNone
    End If
    Next mTask
    End Sub



    Kind Regards,

    Stu

  2. #2
    VBAX Newbie
    Joined
    Mar 2015
    Posts
    3
    Location
    I am finding that MS-Project VBA seems to be very low on experts / advice out there.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •