title | ms.service | ms.assetid | ms.date | ms.localizationpriority |
---|---|---|---|---|
Chart.Export method (Project) |
project-server |
4f0ed821-f1c1-0e0b-0583-51b660ffad90 |
06/08/2017 |
medium |
Exports a chart in a graphic file format.
expression.Export (bstr, varFilterName, varInteractive)
expression A variable that represents a Chart object.
Name | Required/Optional | Data type | Description |
---|---|---|---|
bstr | Required | String | The path and name of the exported file. |
varFilterName | Optional | Variant | The language-independent name of the graphic filter as it appears in the registry ( HKLM\\SOFTWARE\Wow6432Node\Microsoft\Shared Tools\Graphics Filters ). |
varInteractive | Optional | Variant | True to display the dialog box that contains the filter-specific options, if any. If varInteractive is False, Project uses the default values for the filter. The default value is False. |
bstr | Required | String | |
varFilterName | Optional | Variant | |
varInteractive | Optional | Variant |
Boolean
The Export method overwrites an existing read/write file of the same name.
The following example exports the chart as a Portable Network Graphics (.png) file.
Sub ExportChart()
Dim chartShape As Shape
Dim reportName As String
Dim fileFormat As String
Dim fileName As String
fileFormat = "PNG"
fileName = "C:\Project\VBA\Samples\SimpleChart.png"
reportName = "Simple scalar chart"
Set chartShape = ActiveProject.Reports(reportName).Shapes(1)
If (chartShape.Chart.Export(bstr:=filename, varFilterName:=fileFormat)) Then
Debug.Print "Exported chart: " & filename
End If
End Sub
[!includeSupport and feedback]