Condividi tramite


ChartSheet.Export(String, Object, Object) Method

Definition

Exports the ChartSheet in a graphic format.

public bool Export (string Filename, object FilterName, object Interactive);
abstract member Export : string * obj * obj -> bool
Public Function Export (Filename As String, Optional FilterName As Object, Optional Interactive As Object) As Boolean

Parameters

Filename
String

The name of the exported file.

FilterName
Object

The language-independent name of the graphic filter as it appears in the registry.

Interactive
Object

true to display the dialog box that contains the filter-specific options. If this argument is false, Microsoft Office Excel uses the default values for the filter. The default value is false.

Returns

Examples

The following code example uses the Export method to export the current Microsoft.Office.Tools.Excel.ChartSheet as a .gif file without displaying the file options.

private void ExportChartSheetAsGIF()
{
    Globals.Sheet1.Range["A1", "A5"].Value2 = 22;
    Globals.Sheet1.Range["B1", "B5"].Value2 = 55;

    this.SetSourceData(Globals.Sheet1.Range["A1", "B5"],
        Excel.XlRowCol.xlColumns);
    this.ChartType = Excel.XlChartType.xlColumnClustered;

    this.Export(@"C:\Chart1.gif", "GIF", false);
}
Private Sub ExportChartSheetAsGIF()
    Globals.Sheet1.Range("A1", "A5").Value2 = 22
    Globals.Sheet1.Range("B1", "B5").Value2 = 55

    Me.SetSourceData(Globals.Sheet1.Range("A1", "B5"), _
        Excel.XlRowCol.xlColumns)
    Me.ChartType = Excel.XlChartType.xlColumnClustered
    Me.Export("C:\Chart1.gif", "GIF", False)
End Sub

Remarks

Optional Parameters

For information on optional parameters, see Optional Parameters in Office Solutions.

Applies to