Workbook.ExportAsFixedFormat (Excel)

The ExportAsFixedFormat method is used to publish a workbook to either the PDF or XPS format.

ExportAsFixedFormat (Type, Filename, Quality, IncludeDocProperties, IgnorePrintAreas, From, To, OpenAfterPublish, FixedFormatExtClassPtr, WorkIdentity)


ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF

Arguments

The following argument is required

Type (XlFixedFormatType) - Can be either xlTypePDF or xlTypeXPS.

Possible return values are xlTypePDF - "PDF" - Portable Document Format file (.pdf), xlTypeXPS - "XPS" - XPS Document (.xps).

Optional arguments

The following arguments are optional

Filename (String) - A string that indicates the name of the file to be saved. You can include a full path, or Excel saves the file in the current folder.

Quality (XlFixedFormatQuality) - Can be set to either of the following XlFixedFormatQuality constants: xlQualityStandard or xlQualityMinimum.

Possible return values are xlQualityMinimum - Minimum quality, xlQualityStandard - Standard quality.

IncludeDocProperties (Boolean) - Set to True to indicate that document properties should be included, or set to False to indicate that they are omitted.

IgnorePrintAreas (Boolean) - If set to True, ignores any print areas set when publishing. If set to False, uses the print areas set when publishing.

From (Long) - The number of the page at which to start publishing. If this argument is omitted, publishing starts at the beginning.

To (Long) - The number of the last page to publish. If this argument is omitted, publishing ends with the last page.

OpenAfterPublish - If set to True, displays the file in the viewer after it is published. If set to False, the file is published but not displayed

FixedFormatExtClassPtr - Pointer to the FixedFormatExt class

WorkIdentity