Export Method

See Also         Example         Applies To

PivotTable object (Syntax 1): Saves the specified PivotTable list to a file and optionally opens it in Microsoft Excel.

Worksheet object (Syntax 2): Saves the specified worksheet to a file and optionally opens it in Excel.

Syntax 1 (PivotTable object)

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 Temp folder.

Action   Optional PivotExportActionEnum constant. Specifies what happens after the PivotTable list is saved to a file. If you do not specify this argument, the PivotTable list is opened in Excel. If Excel is not installed on the user's machine, an alert is displayed.

Syntax 2 (Worksheet object)

expression.Export(FileName, ExportAction)

expression   An expression that returns a Worksheet 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 Temp folder. You must specify this argument if the ExportAction argument is set to ssExportActionNone.

ExportAction   Optional SheetExportActionEnum constant. Specifies whether or not the worksheet is saved to a file. If you do not specify this argument, the worksheet is opened in Excel. If Excel is not installed on the user's machine, an alert is displayed.