hideSheet - cfsimplicity/spreadsheet-cfml GitHub Wiki

Hides the specified sheet from the UI. If a sheet name or number is not specified, the currently active sheet will be hidden.

hideSheet( workbook[, sheetName[, sheetNumber] ] )

Required arguments

  • workbook spreadsheet object

Optional arguments

  • sheetName string: the name of the sheet to hide OR
  • sheetNumber numeric: the number (1 based, not zero-based) of the sheet to hide

Chainable? Yes.

Note

  • Your spreadsheet must have at least one visible sheet. In other words, this function will not work on the last visible sheet.

Example

spreadsheet = New spreadsheet.spreadsheet()
data = [ [ "a", "b" ], [ "c", "d" ] ]
path = ExpandPath( "test.xlsx" )
workbook = spreadsheet.newXlsx( "SheetToHide" )
spreadsheet.addRows( workbook, data )
  .createSheet( workbook, "SheetToShow" )
  .hideSheet( workbook, "SheetToHide" )
  .write( workbook, path, true )