Skip to content

Latest commit

 

History

History
56 lines (36 loc) · 1.53 KB

Project.chart.savecharttemplate.md

File metadata and controls

56 lines (36 loc) · 1.53 KB
title ms.service ms.assetid ms.date ms.localizationpriority
Chart.SaveChartTemplate method (Project)
project-server
496eb522-d758-ea4c-1cd9-4884c3b44189
06/08/2017
medium

Chart.SaveChartTemplate method (Project)

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

Syntax

expression. SaveChartTemplate (bstrFileName)

expression A variable that represents a Chart object.

Parameters

Name Required/Optional Data type Description
bstrFileName Required String The name of the chart template.
bstrFileName Required String

Return value

Nothing

Remarks

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.

Example

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

Chart Object SetDefaultChart Method

[!includeSupport and feedback]