SetScheduleVerticalLines is not changing the grid lines (for programmers)

Question:     

I'm using the automation interface to build a schedule based on a template.  However, I'm trying to set/control some of the properties of the chart.  Most of it is working just fine, but for some reason I'm not able to correctly set the Gantt Chart vertical grid line properties correctly.  Initially I create the Milestones object:

        Dim oM = CreateObject("Milestones")

        oM.Activate()

        oM.Use20Columns()

        oM.AutoSizeRows(1)

        oM.AllColorsAreRGB()

Later on, as I'm setting properties of the chart, I want to set the vertical grid lines to calendar year, red and dotted:

        oM.SetScheduleVerticalGridlines(0, CStr(RGB(255, 0, 0)), 1, 1)

However, the grid lines remain fiscal year, black and solid, and this is before I've added any task rows at all.  Am I calling it incorrectly or something?

 

Answer:

Since you can have multiple grid lines (Yearly, Monthly, Quarterly) at the same time, it appears that you need to "unset" the FY gridlines first.  If you call with a frequency of zero the FY gridlines will become "unset".  Then, what you have should work.  

 

 

 

 

 

 


 

Related topics

Automation interface to Milestones

Adjust task row height with automation

Putcell method and column numbering

Licensing for automation

 

 

 

 

 

Applies to Milestones Professional:      2019        2021        2023        2025

 

 

 

 

      

The fast easy way to schedule your projects:  Milestones Software by KIDASA Software, Inc. www.kidasa.com

Copyright © 2025 KIDASA Software, Inc. All rights reserved.