The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Workbook.ExportAsFixedFormat Method

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

Version Information
 Version Added:  Excel 2007


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

expression   A variable that represents a Workbook, Sheet, Chart, or Range object.


NameRequired/OptionalData TypeDescription
TypeRequiredXlFixedFormatTypeCan be either xlTypePDF or xlTypeXPS.
FilenameOptionalVariantA string that indicates the name of the file to be saved. You can include a full path or Excel 2007 saves the file in the current folder.
QualityOptionalVariantCan be set to either xlQualityStandard or xlQualityMinimum.
IncludeDocPropertiesOptionalVariantSet to True to indicate that document properties should be included or set to False to indicate that they are omitted.
IgnorePrintAreasOptionalVariantIf set to True, ignores any print areas set when publishing. If set to False, will use the print areas set when publishing.
FromOptionalVariantThe number of the page at which to start publishing. If this argument is omitted, publishing starts at the beginning.
ToOptionalVariantThe number of the last page to publish. If this argument is omitted, publishing ends with the last page
OpenAfterPublishOptionalVariantIf set to True displays file in viewer after it is published. If set to False the file is published but not displayed.
FixedFormatExtClassPtrOptionalVariantPointer to the FixedFormatExt class.


The following example creates the PDF at standard quality in the current file’s directory and displays file in viewer after it is published.

Bb238907.vs_note(en-us,office.12).gif  Note
An error will occur if the PDF add-in is not currently installed.
Visual Basic for Applications
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF FileName:=“sales.pdf” Quality:=xlQualityStandard DisplayFileAfterPublish:=True 

Community Additions