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

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Microsof...', 1758199563, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Microsoft/Office/Excel/Object-Model/Workbook/exportAsFixedFormat(80): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78