Trait

com.google.appsscript.spreadsheet

Spreadsheet

Related Doc: package spreadsheet

Permalink

trait Spreadsheet extends Object

Spreadsheet This class allows users to access and modify Google Sheets files. Common operations are adding new sheets and adding collaborators.

Annotations
@RawJSType()
Linear Supertypes
Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Spreadsheet
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def addEditor(user: User): Spreadsheet

    Permalink

    Adds the given user to the list of editors for the Spreadsheet.

    Adds the given user to the list of editors for the Spreadsheet. If the user was already on the list of viewers, this method promotes the user out of the list of viewers.

  5. def addEditor(emailAddress: String): Spreadsheet

    Permalink

    Adds the given user to the list of editors for the Spreadsheet.

    Adds the given user to the list of editors for the Spreadsheet. If the user was already on the list of viewers, this method promotes the user out of the list of viewers.

  6. def addEditors(emailAddresses: Array[String]): Spreadsheet

    Permalink

    Adds the given array of users to the list of editors for the Spreadsheet.

    Adds the given array of users to the list of editors for the Spreadsheet. If any of the users were already on the list of viewers, this method promotes them out of the list of viewers.

  7. def addMenu(name: String, subMenus: Array[AnyRef]): Unit

    Permalink

    Creates a new menu in the Spreadsheet UI.

    Creates a new menu in the Spreadsheet UI. Each menu entry runs a user-defined function. Usually, you will want to call it from the onOpen function so that the menu is automatically created when the Spreadsheet is loaded.

  8. def addViewer(user: User): Spreadsheet

    Permalink

    Adds the given user to the list of viewers for the Spreadsheet.

    Adds the given user to the list of viewers for the Spreadsheet. If the user was already on the list of editors, this method has no effect.

  9. def addViewer(emailAddress: String): Spreadsheet

    Permalink

    Adds the given user to the list of viewers for the Spreadsheet.

    Adds the given user to the list of viewers for the Spreadsheet. If the user was already on the list of editors, this method has no effect.

  10. def addViewers(emailAddresses: Array[String]): Spreadsheet

    Permalink

    Adds the given array of users to the list of viewers for the Spreadsheet.

    Adds the given array of users to the list of viewers for the Spreadsheet. If any of the users were already on the list of editors, this method has no effect for them.

  11. def appendRow(rowContents: Array[AnyRef]): Sheet

    Permalink

    Appends a row to the spreadsheet.

    Appends a row to the spreadsheet. This operation is atomic; it prevents issues where a user asks for the last row, and then writes to that row, and an intervening mutation occurs between getting the last row and writing to it.

  12. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  13. def autoResizeColumn(columnPosition: Int): Sheet

    Permalink

    Sets the width of the given column to fit its contents

  14. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  15. def copy(name: String): Spreadsheet

    Permalink

    Copies the spreadsheet and returns the new one.

  16. def deleteActiveSheet(): Sheet

    Permalink

    Deletes the currently active sheet.

  17. def deleteColumn(columnPosition: Int): Sheet

    Permalink

    Deletes the column at the given column position.

  18. def deleteColumns(columnPosition: Int, howMany: Int): Unit

    Permalink

    Deletes a number of columns starting at the given column position.

  19. def deleteRow(rowPosition: Int): Sheet

    Permalink

    Deletes the row at the given row position.

  20. def deleteRows(rowPosition: Int, howMany: Int): Unit

    Permalink

    Deletes a number of rows starting at the given row position.

  21. def deleteSheet(sheet: Sheet): Unit

    Permalink

    Deletes the specified sheet.

  22. def duplicateActiveSheet(): Sheet

    Permalink

    Duplicates the active sheet and makes it the active sheet.

  23. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  24. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  25. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  26. def getActiveCell(): Range

    Permalink

    Returns the active cell in this sheet.

  27. def getActiveRange(): Range

    Permalink

    Returns the active range for the active sheet.

    Returns the active range for the active sheet. Returns the range of cells that is currently considered active. This generally means the range that a user has selected in the active sheet, but in a custom function it refers to the cell being actively recalculated. Note that when called on a SpreadsheetApp it effectively calls getActiveSpreadsheet and then getActiveSheet to act on the active Sheet.

  28. def getActiveSheet(): Sheet

    Permalink

    Gets the active sheet in a spreadsheet.

    Gets the active sheet in a spreadsheet. The active sheet in a spreadsheet is the sheet that is being displayed in the spreadsheet UI.

  29. def getAs(contentType: String): Blob

    Permalink

    Return the data inside this object as a blob converted to the specified content type.

    Return the data inside this object as a blob converted to the specified content type. This method adds the appropriate extension to the filename — for example, "myfile.pdf". However, it assumes that the part of the filename that follows the last period (if any) is an existing extension that should be replaced. Consequently, "ChristmasList.12.25.2014" will become "ChristmasList.12.25.pdf".

  30. def getBlob(): Blob

    Permalink

    Return the data inside this object as a blob.

  31. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  32. def getColumnWidth(columnPosition: Int): Int

    Permalink

    Gets the width in pixels of the given column.

  33. def getDataRange(): Range

    Permalink

    Returns a Range corresponding to the dimensions in which data is present.

    Returns a Range corresponding to the dimensions in which data is present. This is functionally equivalent to creating a Range bounded by A1 and (Range.getLastColumn(), Range.getLastRow()).

  34. def getEditors(): Array[User]

    Permalink

    Gets the list of editors for this Spreadsheet.

    Gets the list of editors for this Spreadsheet. If the user who executes the script does not have edit access to the Spreadsheet, this method throws an exception.

  35. def getFormUrl(): String

    Permalink

    Returns the url for the form attached to the spreadsheet, null if there is no form.

  36. def getFrozenColumns(): Int

    Permalink

    Returns the number of frozen columns.

  37. def getFrozenRows(): Int

    Permalink

    Returns the number of frozen rows.

  38. def getId(): String

    Permalink

    Gets a unique identifier for this spreadsheet.

    Gets a unique identifier for this spreadsheet. A spreadsheet ID can be extracted from its URL. For example, the spreadsheet ID in the URL https://docs.google.com/spreadsheets/d/abc1234567/edit#gid=0 is "abc1234567".

  39. def getLastColumn(): Int

    Permalink

    Returns the position of the last column that has content.

  40. def getLastRow(): Int

    Permalink

    Returns the position of the last row that has content.

  41. def getName(): String

    Permalink

    Gets the name of the document.

  42. def getNumSheets(): Int

    Permalink

    Returns the number of sheets in this spreadsheet.

  43. def getOwner(): User

    Permalink

    Returns the owner of the document.

  44. def getProtections(type: ProtectionType): Array[Protection]

    Permalink

    Gets an array of objects representing all protected ranges or sheets in the spreadsheet.

  45. def getRange(a1Notation: String): Range

    Permalink

    Returns the range as specified in A1 notation or R1C1 notation.

  46. def getRangeByName(name: String): Range

    Permalink

    Returns a named range, or null if no range with the given name is found.

    Returns a named range, or null if no range with the given name is found. If multiple sheets of the spreadsheet use the same range name, specify the sheet name without additional quotation marks — for example, getRangeByName('TaxRates') or getRangeByName('Sheet Name!TaxRates'), but not getRangeByName('"Sheet Name"!TaxRates').

  47. def getRowHeight(rowPosition: Int): Int

    Permalink

    Gets the height in pixels of the given row.

  48. def getSheetByName(name: String): Sheet

    Permalink

    Returns a sheet with the given name.

    Returns a sheet with the given name. If multiple sheets have the same name, the leftmost one is returned. Returns null if there is no sheet with the given name.

  49. def getSheetId(): Int

    Permalink

    Returns the ID of the sheet represented by this object.

    Returns the ID of the sheet represented by this object. This is an ID for the sheet that is unique to the spreadsheet. The ID is a monotonically increasing integer assigned at sheet creation time that is independent of sheet position. This is useful in conjunction with methods such as Range.copyFormatToRange(gridId, column, columnEnd, row, rowEnd) that take a gridId parameter rather than a Sheet instance.

  50. def getSheetName(): String

    Permalink

    Returns the sheet name.

  51. def getSheetProtection(): PageProtection

    Permalink

    Deprecated.

    Deprecated. For spreadsheets created in the newer version of Google Sheets, use Sheet.getProtections(type), which returns the more powerful Protection class. Although this method is deprecated, it will remain available for compatibility with the older version of Sheets

  52. def getSheetValues(startRow: Int, startColumn: Int, numRows: Int, numColumns: Int): Array[Array[AnyRef]]

    Permalink

    Returns the rectangular grid of values for this range starting at the given coordinates.

    Returns the rectangular grid of values for this range starting at the given coordinates. A -1 value given as the row or column position is equivalent to getting the very last row or column that has data in the sheet.

  53. def getSheets(): Array[Sheet]

    Permalink

    Gets all the sheets in this spreadsheet.

  54. def getSpreadsheetLocale(): String

    Permalink

    Gets the spreadsheet locale.

  55. def getSpreadsheetTimeZone(): String

    Permalink

    Gets the time zone for the spreadsheet.

  56. def getUrl(): String

    Permalink

    Returns the url for the given spreadsheet.

  57. def getViewers(): Array[User]

    Permalink

    Gets the list of viewers and commenters for this Spreadsheet.

    Gets the list of viewers and commenters for this Spreadsheet. If the user who executes the script does not have edit access to the Spreadsheet, this method throws an exception.

  58. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  59. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  60. def hideColumn(column: Range): Unit

    Permalink

    Hides the columns in the given range.

  61. def hideRow(row: Range): Unit

    Permalink

    Hides the rows in the given range.

  62. def insertColumnAfter(afterPosition: Int): Sheet

    Permalink

    Inserts a column after the given column position.

  63. def insertColumnBefore(beforePosition: Int): Sheet

    Permalink

    Inserts a column before the given column position.

  64. def insertColumnsAfter(afterPosition: Int, howMany: Int): Sheet

    Permalink

    Inserts a number of columns after the given column position.

  65. def insertColumnsBefore(beforePosition: Int, howMany: Int): Sheet

    Permalink

    Inserts a number of columns before the given column position.

  66. def insertImage(url: String, column: Int, row: Int, offsetX: Int, offsetY: Int): Unit

    Permalink

    Inserts an image in the document at a given row and column, with a pixel offset.

  67. def insertImage(url: String, column: Int, row: Int): Unit

    Permalink

    Inserts an image in the document at a given row and column.

  68. def insertImage(blob: Blob, column: Int, row: Int, offsetX: Int, offsetY: Int): Unit

    Permalink

    Inserts a Blob as an image in the document at a given row and column, with a pixel offset.

    Inserts a Blob as an image in the document at a given row and column, with a pixel offset. The image size is retrieved from the blob contents.

  69. def insertImage(blob: Blob, column: Int, row: Int): Unit

    Permalink

    Inserts a Blob as an image in the document at a given row and column.

    Inserts a Blob as an image in the document at a given row and column. The image size is retrieved from the blob contents.

  70. def insertRowAfter(afterPosition: Int): Sheet

    Permalink

    Inserts a row after the given row position.

  71. def insertRowBefore(beforePosition: Int): Sheet

    Permalink

    Inserts a row before the given row position.

  72. def insertRowsAfter(afterPosition: Int, howMany: Int): Sheet

    Permalink

    Inserts a number of rows after the given row position.

  73. def insertRowsBefore(beforePosition: Int, howMany: Int): Sheet

    Permalink

    Inserts a number of rows before the given row position.

  74. def insertSheet(sheetName: String, options: AnyRef): Sheet

    Permalink

    Inserts a new sheet in the spreadsheet with the given name and uses optional advanced arguments.

    Inserts a new sheet in the spreadsheet with the given name and uses optional advanced arguments. As a side effect, it makes it the active sheet.

  75. def insertSheet(sheetName: String, sheetIndex: Int, options: AnyRef): Sheet

    Permalink

    Inserts a new sheet in the spreadsheet with the given name at the given index and uses optional advanced arguments.

    Inserts a new sheet in the spreadsheet with the given name at the given index and uses optional advanced arguments. As a side effect, it makes it the active sheet.

  76. def insertSheet(sheetName: String, sheetIndex: Int): Sheet

    Permalink

    Inserts a new sheet in the spreadsheet with the given name at the given index.

    Inserts a new sheet in the spreadsheet with the given name at the given index. As a side effect, it makes it the active sheet.

  77. def insertSheet(sheetName: String): Sheet

    Permalink

    Inserts a new sheet in the spreadsheet with the given name.

    Inserts a new sheet in the spreadsheet with the given name. As a side effect, it makes it the active sheet.

  78. def insertSheet(options: AnyRef): Sheet

    Permalink

    Inserts a new sheet in the spreadsheet, with a default name and uses optional advanced arguments.

    Inserts a new sheet in the spreadsheet, with a default name and uses optional advanced arguments. As a side effect, it makes it the active sheet.

  79. def insertSheet(sheetIndex: Int, options: AnyRef): Sheet

    Permalink

    Inserts a new sheet in the spreadsheet at the given index and uses optional advanced arguments.

    Inserts a new sheet in the spreadsheet at the given index and uses optional advanced arguments. As a side effect, it makes it the active sheet.

  80. def insertSheet(sheetIndex: Int): Sheet

    Permalink

    Inserts a new sheet in the spreadsheet at the given index.

    Inserts a new sheet in the spreadsheet at the given index. As a side effect, it makes it the active sheet.

  81. def insertSheet(): Sheet

    Permalink

    Inserts a new sheet in the spreadsheet, with a default name.

    Inserts a new sheet in the spreadsheet, with a default name. As a side effect, it makes it the active sheet.

  82. def isAnonymousView(): Boolean

    Permalink

    Deprecated.

    Deprecated. As of January 2014 this function is deprecated and not available in the new version of Google Sheets.

  83. def isAnonymousWrite(): Boolean

    Permalink

    Deprecated.

    Deprecated. As of January 2014 this function is deprecated and not available in the new version of Google Sheets.

  84. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  85. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  86. def moveActiveSheet(pos: Int): Unit

    Permalink

    Moves the active sheet to the given position in the list of sheets.

    Moves the active sheet to the given position in the list of sheets. Throws an exception if the position is negative or greater than the number of sheets.

  87. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  88. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  89. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  90. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  91. def removeEditor(user: User): Spreadsheet

    Permalink

    Removes the given user from the list of editors for the Spreadsheet.

    Removes the given user from the list of editors for the Spreadsheet. This method does not block users from accessing the Spreadsheet if they belong to a class of users who have general access — for example, if the Spreadsheet is shared with the user's entire domain.

  92. def removeEditor(emailAddress: String): Spreadsheet

    Permalink

    Removes the given user from the list of editors for the Spreadsheet.

    Removes the given user from the list of editors for the Spreadsheet. This method does not block users from accessing the Spreadsheet if they belong to a class of users who have general access — for example, if the Spreadsheet is shared with the user's entire domain.

  93. def removeMenu(name: String): Unit

    Permalink

    Removes a menu that was added by addMenu(name, subMenus).

    Removes a menu that was added by addMenu(name, subMenus). The name argument should have the same value as the corresponding call to addMenu(name, subMenus).

  94. def removeNamedRange(name: String): Unit

    Permalink

    Deletes a named range with the given name.

    Deletes a named range with the given name. Throws an exception if no range with the given name is found in the spreadsheet.

  95. def removeViewer(user: User): Spreadsheet

    Permalink

    Removes the given user from the list of viewers and commenters for the Spreadsheet.

    Removes the given user from the list of viewers and commenters for the Spreadsheet. This method has no effect if the user is an editor, not a viewer. This method also does not block users from accessing the Spreadsheet if they belong to a class of users who have general access — for example, if the Spreadsheet is shared with the user's entire domain.

  96. def removeViewer(emailAddress: String): Spreadsheet

    Permalink

    Removes the given user from the list of viewers and commenters for the Spreadsheet.

    Removes the given user from the list of viewers and commenters for the Spreadsheet. This method has no effect if the user is an editor, not a viewer or commenter. This method also does not block users from accessing the Spreadsheet if they belong to a class of users who have general access — for example, if the Spreadsheet is shared with the user's entire domain.

  97. def rename(newName: String): Unit

    Permalink

    Renames the document.

  98. def renameActiveSheet(newName: String): Unit

    Permalink

    Renames the current active sheet to the given new name.

  99. def setActiveRange(range: Range): Range

    Permalink

    Sets the active range for the active sheet.

  100. def setActiveSelection(a1Notation: String): Range

    Permalink

    Sets the active selection, as specified in A1 notation or R1C1 notation.

  101. def setActiveSelection(range: Range): Range

    Permalink

    Sets the active selection region for this sheet.

  102. def setActiveSheet(sheet: Sheet): Sheet

    Permalink

    Sets the given sheet to be the active sheet in the spreadsheet.

    Sets the given sheet to be the active sheet in the spreadsheet. The spreadsheet UI will display the chosen sheet unless the sheet belongs to a different spreadsheet.

  103. def setAnonymousAccess(anonymousReadAllowed: Boolean, anonymousWriteAllowed: Boolean): Unit

    Permalink

    Deprecated.

    Deprecated. As of January 2014 this function is deprecated and not available in the new version of Google Sheets.

  104. def setColumnWidth(columnPosition: Int, width: Int): Sheet

    Permalink

    Sets the width of the given column in pixels.

  105. def setFrozenColumns(columns: Int): Unit

    Permalink

    Freezes the given number of columns.

    Freezes the given number of columns. If zero, no columns are frozen.

  106. def setFrozenRows(rows: Int): Unit

    Permalink

    Freezes the given number of rows.

    Freezes the given number of rows. If zero, no rows are frozen.

  107. def setNamedRange(name: String, range: Range): Unit

    Permalink

    Names a range.

  108. def setRowHeight(rowPosition: Int, height: Int): Sheet

    Permalink

    Sets the row height of the given row in pixels.

  109. def setSheetProtection(permissions: PageProtection): Unit

    Permalink

    Deprecated.

    Deprecated. For spreadsheets created in the newer version of Google Sheets, use Sheet.protect(), which returns the more powerful Protection class. Although this method is deprecated, it will remain available for compatibility with the older version of Sheets

  110. def setSpreadsheetLocale(locale: String): Unit

    Permalink

    Sets the spreadsheet locale.

  111. def setSpreadsheetTimeZone(timezone: String): Unit

    Permalink

    Sets the time zone for the spreadsheet.

  112. def show(userInterface: AnyRef): Unit

    Permalink

    Displays a custom user interface component in a dialog centered in the user's browser's viewport.

    Displays a custom user interface component in a dialog centered in the user's browser's viewport. The server-side script's execution will not be suspended. To communicate with the server side, the user interface component must make asynchronous callbacks to the server-side script.

  113. def sort(columnPosition: Int, ascending: Boolean): Sheet

    Permalink

    Sorts a sheet by column.

    Sorts a sheet by column. Takes a parameter to specify ascending or descending.

  114. def sort(columnPosition: Int): Sheet

    Permalink

    Sorts a sheet by column, ascending.

  115. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  116. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  117. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  118. def toast(msg: String, title: String, timeoutSeconds: Number): Unit

    Permalink

    Shows a popup window in the lower right corner of the spreadsheet with the given title and message, that stays visible for a certain length of time.

  119. def toast(msg: String, title: String): Unit

    Permalink

    Shows a popup window in the lower right corner of the spreadsheet with the given message and title.

  120. def toast(msg: String): Unit

    Permalink

    Shows a popup window in the lower right corner of the spreadsheet with the given message.

  121. def unhideColumn(column: Range): Unit

    Permalink

    Unhides the column in the given range.

  122. def unhideRow(row: Range): Unit

    Permalink

    Unhides the row in the given range.

  123. def updateMenu(name: String, subMenus: Array[AnyRef]): Unit

    Permalink

    Updates a menu that was added by addMenu(name, subMenus).

    Updates a menu that was added by addMenu(name, subMenus). Works exactly like addMenu(name, subMenus).

  124. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  125. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  126. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  127. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped