Skip to content

Latest commit

 

History

History
71 lines (45 loc) · 1.91 KB

Project.chart.export.md

File metadata and controls

71 lines (45 loc) · 1.91 KB
title ms.service ms.assetid ms.date ms.localizationpriority
Chart.Export method (Project)
project-server
4f0ed821-f1c1-0e0b-0583-51b660ffad90
06/08/2017
medium

Chart.Export method (Project)

Exports a chart in a graphic file format.

Syntax

expression.Export (bstr, varFilterName, varInteractive)

expression A variable that represents a Chart object.

Parameters

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

Return value

Boolean

Remarks

The Export method overwrites an existing read/write file of the same name.

Example

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

See also

Chart Object

[!includeSupport and feedback]