title | ms.service | ms.assetid | ms.date | ms.localizationpriority |
---|---|---|---|---|
Chart.SaveChartTemplate method (Project) |
project-server |
496eb522-d758-ea4c-1cd9-4884c3b44189 |
06/08/2017 |
medium |
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.
Name | Required/Optional | Data type | Description |
---|---|---|---|
bstrFileName | Required | String | The name of the chart template. |
bstrFileName | Required | String |
Nothing
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
Chart Object SetDefaultChart Method
[!includeSupport and feedback]