property Chart.CountVisibleUnits ([Start as Variant], [End as Variant]) as Long
Counts the number of units within the specified range.

TypeDescription
Start as Variant A DATE expression that specifies the starting date, if missing, the StartPrintDate value is used.
End as Variant A DATE expression that specifies the ending date, if missing, the EndPrintDate value is used.
Long A long expression that specifies the number of units within the specified range.
Use the CountVisibleUnits property to count the number of units within the specified range. The UnitScale property indicates the time-unit scale being displayed by the chart's header. Use the CountVisibleUnits property to count the number of units so the entire chart is displayed on a specified size. Use the UnitWidth property specifies the width in pixels for the minimal time-unit. Use the CountVisibleUnits property and the ClientWidth property of the eXPrint component (Retrieves the width in pixels, of the drawing area of the printer page) to specify that you need to display the chart on a single page. The StartPrintDate and EndPrintDate property specifies range of dates within the chart is printed. 

When computing the UnitWidth property for printing to a page ( as shown in the following sample ), you can still use the Count property of the Level object to display more units instead one.

The following VB sample changes the UnitWidth property so, the entire chart is printed to the page:

With Print1
    Dim l As Long
    With Gantt1.Chart
        l = .UnitWidth
        .UnitWidth = (Print1.ClientWidth - .PaneWidth(False)) / .CountVisibleUnits()
    End With
    Set .PrintExt = Gantt1.Object
    .Preview
    Gantt1.Chart.UnitWidth = l
End With

The ClientWidth property of the eXPrint specifies the number of pixels in the page, the PaneWidth property specifies the width of the columns area. The sample restores the UnitWidth property once, the Preview method is called.