Google-sheets – Script to display workbook title in Google Sheet

google sheetsgoogle-apps-script

I read on here how to use the script =sheetName() to display the sheet name, but is there another script I can use to display the workbook title?

I use daily sheets and the title for the sheets are the date. When I print them, I want it to display the date (located in the title).
(I know I can show the title in the print settings but that's a lot of steps if I'm mass printing)

Best Answer

Use the getName() method from the Class Spreadsheet.


We don't need a script to display the Spreadsheet title when printing.

  1. Click on File > Print
  2. On the right panel, expand the Headers & footers section
  3. Check the Workbook title to add it to the default field or click on Edit Custom Fields to add it to the field that prefer.