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

Chart.Export Method (Project)

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

Exports a chart in a graphic file format.

Syntax

expression. Export(bstr,? varFilterName,? varInteractive)

expression A variable that represents a Chart object.

Parameters

NameRequired/OptionalData typeDescription
bstrRequiredStringThe path and name of the exported file.
varFilterNameOptionalVariantThe language-independent name of the graphic filter as it appears in the registry ( HKLM\\SOFTWARE\Wow6432Node\Microsoft\Shared Tools\Graphics Filters).
varInteractiveOptionalVariantTrue 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.
bstrRequiredSTRING
varFilterNameOptionalVARIANT
varInteractiveOptionalVARIANT

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

Other resources

Chart Object

© 2018 Microsoft