Table of contents
TOC
Collapse the table of content
Expand the table of content

Chart.AutoFormat Method (Project)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Changes the chart to a default format for another chart type.

Syntax

expression. AutoFormat(rGallery,varFormat)

expression A variable that represents a Chart object.

Parameters

NameRequired/OptionalData typeDescription
rGalleryRequiredLongOne of the constants of the Office.XlChartType enumeration, which specifies the chart type.
varFormatOptionalVariantThe option number for the built-in autoformats. Can be a number from 1 through 10, depending on the gallery type. If the varFormat argument is omitted, Project chooses a default value based on the gallery type and data source.
rGalleryRequiredINT32
varFormatOptionalVARIANT

Return value

Nothing

Remarks

The ChartWizard method can do the same job as the AutoFormat method, although ChartWizard has more options.

Example

The following example changes the chart to the default 3-D Stacked Area format.

Sub TestAutoFormat()
    Dim chartShape As Shape
    Dim reportName As String

    reportName = "Simple scalar chart"
    Set chartShape = ActiveProject.Reports(reportName).Shapes(1)

    chartShape.Chart.AutoFormat Office.XlChartType.xl3DAreaStacked
End Sub

See also

Other resources

Chart ObjectChartWizard Method

© 2018 Microsoft