Macros/Calc/016

Description
This macro exports a Calc sheet to a PDF. Note that this can be done without a macro, by, and choosing "Selection/Selected sheet(s)". However it can be desirable to automate/customize this process via a macro, as shown below.

This solution is operating system independent.

All the print ranges are deleted, then the used area of the sheet is defined as print range, then exported as PDF.

Run the  subroutine, and specify the sheet name inside the quotes.

After that the macro is ready to use. Simply start the macro from a Calc file, such as the one included below.

Code
In LibreOffice Basic:

ODS file to test macro

 * [[Media:Example macro to export Calc sheet to PDF.ods| Download ODS file with this macro embedded ]]