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

Chart.SaveChartTemplate Method (Project)

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

Saves a custom chart template to the list of available chart templates or to a file.


expression. SaveChartTemplate(bstrFileName)

expression A variable that represents a Chart object.


NameRequired/OptionalData typeDescription
bstrFileNameRequiredStringThe name of the chart template.

Return value



By default, the SaveChartTemplate method saves the active chart to the user's chart template directory (for example C:\Users\username.DOMAIN\AppData\Roaming\Microsoft\Templates\Charts). If a UNC file path or URL is specified, the chart is saved to the specified location.


The following example saves the chart template in the C:\Project\VBA\Samples\My chart template.crtx file.

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

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

    chartShape.Chart.SaveChartTemplate "C:\Project\VBA\Samples\My chart template"
End Sub

See also

Other resources

Chart ObjectSetDefaultChart Method

© 2018 Microsoft