title | ms.service | ms.assetid | ms.date | ms.localizationpriority |
---|---|---|---|---|
Chart.AutoFormat method (Project) |
project-server |
1f560c0e-aed8-c989-9721-8e30595ae56e |
06/08/2017 |
medium |
Changes the chart to a default format for another chart type.
expression. AutoFormat
(rGallery, varFormat)
expression A variable that represents a Chart object.
Name | Required/Optional | Data type | Description |
---|---|---|---|
rGallery | Required | Long | One of the constants of the Office.XlChartType enumeration, which specifies the chart type. |
varFormat | Optional | Variant | The 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. |
rGallery | Required | INT32 | |
varFormat | Optional | Variant |
Nothing
The ChartWizard method can do the same job as the AutoFormat method, although ChartWizard has more options.
The following example changes the chart to the default 3D 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
Chart Object ChartWizard Method
[!includeSupport and feedback]