Search notes:

Excel Object Model: workbook.exportAsFixedFormat

The exportAsFixedFormat method of a workbook object publishes the content of a workbook either in the PDF or XPS format.

Export a subset of the available worksheets

It is also possible to use sheets(array(… )) to select a subset of the available sheets in a workbook to be printed. This is demonstrated with the following simple example:
option explicit

sub main() ' {

    createSheet "sheet one"
    createSheet "sheet two"
    createSheet "sheet three"
    createSheet "sheet four"
    createSheet "sheet five"

    activeWorkbook.sheets(array("sheet two", "sheet five", "sheet four")).select
    
    activeSheet.exportAsFixedFormat           _
       type             :=  xlTypePDF       , _
       fileName         := "exported-sheets", _
       openafterpublish :=  true            , _
       ignoreprintareas :=  false

end sub ' }

sub createSheet(name as string) ' {

    dim sh as worksheet
    set sh = activeWorkbook.sheets.add
    sh.name = name

    sh.cells(2,2) = name

end sub ' }
Github repository about-MS-Office-object-model, path: /Excel/Workbook/exportAsFixedFormat.bas

See also

Selecting multiple sheets to write on them concurrently.
There is also a exportAsFixedFormat method in the worksheet object.
Excel Object Model

Index