Example 4 - Add rows and symbols using a counter

Summary: This program starts Milestones Professional, creates a new file, and then places text into seven task lines, one per row, and then adds seven symbols using a counter for the month. Note that this program assumes that month is the first position of the sort date format.  

    Public Sub Example4()

        Dim objmilestones As Object

        Dim strtemp As String

        objMilestones = CreateObject("Milestones")

        With objMilestones

            .Activate()

            .use20columns()

            For ncounter = 1 To 20

                .setcolumnproperty(ncounter, "width", 0)

                .setcolumnproperty(ncounter, "SmartColumnA type of column which will automatically fill according to schedule data or entered data. For example, the Symbol Count SmartColumn automatically totals the number of symbols on a task row, and the Duration SmartColumn calculates the length of time between the first symbol and last symbol for each task row.", "none")

            Next

            .setcolumnproperty(10, "width", 1)  'Task Column

            For nCounter = 1 To 7

                strTemp = "This is Task RowA horizontal row on the schedule, usually containing the name of a project step and important milestone dates for that step. " + CStr(nCounter)

                .PutCell(nCounter, 10, strtemp)

                strtemp = CStr(nCounter + 1) + "/1/2017"

                .AddSymbol(nCounter, strTemp, nCounter)

            Next nCounter

            .setstartandenddates("1/1/2017", "12/31/2017")

            .Refresh()

            .KeepScheduleOpen()

        End With

        Exit Sub

        End

    End Sub

Running this program will produce a chart similar to the one below:

 

Milestones Professional 2019 Automation Methods and Properties.  © Copyright 2018, KIDASA Software, Inc. All rights reserved.