Export Method

Export method as it applies to the and PivotTable object.

Saves the specified PivotTable list to a file and optionally opens it in Microsoft Excel.

expression.Export(Filename, Action)

*expression   * An expression that returns a PivotTable object.

Filename    Optional String. Specifies the file name of the saved file. If you do not specify this argument, a temporary file is created in the user's temporaryfolder (the location of the temporary folder varies by operating system).

PivotExportActionEnum

PivotExportActionEnum can be one of these PivotExportActionEnum constants.
plExportActionNone
plExportActionOpenInExceldefault

Export method as it applies to the Spreadsheet object.

expression.Export(Filename, Action, Format)

*expression   * An expression that returns a Spreadsheet object.

Filename    Optional String. Specifies the file name of the saved file. If you do not specify this argument, a temporary file is created in the user's temporary folder (the location of the temporary folder varies by operating system). You must specify this argument if the Action argument is set to ssExportActionNone.

SheetExportActionEnum

SheetExportActionEnum can be one of these SheetExportActionEnum constants.
ssExportActionNone
ssExportActionOpenInExceldefault

SheetExportFormat

SheetExportActionEnum can be one of these SheetExportActionEnum constants.
ssExportAsAppropriatedefault
ssExportHTML

ssExportXMLSpreadsheet

Example

As it applies to the Spreadsheet object.

This example exports the active worksheet to the specified file.

Sub ExportSpreadsheet()

    Dim ssConstants

    Set ssConstants = Spreadsheet1.Constants

    Spreadsheet1.Export "ssheet1.htm", ssConstants.ssExportActionNone, _
        ssConstants.ssExportXMLSpreadsheet

End Sub

Applies to | PivotTable Object | Spreadsheet Object

See Also | ExportPicture Method | ExportXML Method