Skip to main content

Api

Represents the Api class.

Properties

NameTypeDescription
ActiveSheetApiWorksheetReturns an object that represents the active sheet.
AllCommentsApiComment[]Returns all comments from the current workbook including comments from all worksheets.
CommentsApiComment[]Returns all comments related to the whole workbook.
FreezePanesFreezePaneTypeReturns or sets the type of freeze panes.
PivotTablesApiPivotTable[]Returns all pivot tables.
ReferenceStyleReferenceStyleReturns or sets the reference style.
SelectionApiRangeReturns an object that represents the selected range.
SheetsApiWorksheet[]Returns the Sheets collection that represents all the sheets in the active workbook.
WorksheetFunctionApiWorksheetFunctionReturns an object that represents the function list.

Methods

MethodReturnsDescription
AddCommentApiComment | nullReturns an array of ApiComment objects.
AddCustomFunctionNoneCreates a new custom function.\ The description of the function parameters and result is specified using JSDoc. The <em>@customfunction</em> tag is required in JSDoc.\ Parameters and results can be specified as the <em>number / string / boolean / any / number[][] / string[][] / bobooleanol[][] / any[][]</em> types.\ Parameters can be required or optional. A user can also set a default value.
AddCustomFunctionLibraryNoneRegisters a new custom functions library (see the -SetCustomFunctions plugin method).\ The description of the function parameters and result is specified using JSDoc. The <em>@customfunction</em> tag is required in JSDoc.\ Parameters and results can be specified as the <em>number / string / boolean / any / number[][] / string[][] / boolean[][] / any[][]</em> types.\ Parameters can be required or optional. A user can also set a default value.
AddDefNamebooleanAdds a new name to a range of cells.
AddSheetNoneCreates a new worksheet. The new worksheet becomes the active sheet.
ClearCustomFunctionsbooleanClears all custom functions.
CreateBlipFillApiFillCreates a blip fill to apply to the object using the selected image as the object background.
CreateBulletApiBulletCreates a bullet for a paragraph with the character or symbol specified with the sSymbol parameter.
CreateColorByNameApiColorCreates a color selecting it from one of the available color presets.
CreateColorFromRGBApiColorCreates an RGB color setting the appropriate values for the red, green and blue color components.
CreateGradientStopApiGradientStopCreates a gradient stop used for different types of gradients.
CreateLinearGradientFillApiFillCreates a linear gradient fill to apply to the object using the selected linear gradient as the object background.
CreateNewHistoryPointNoneCreates a new history point.
CreateNoFillApiFillCreates no fill and removes the fill from the element.
CreateNumberingApiBulletCreates a bullet for a paragraph with the numbering character or symbol specified with the numType parameter.
CreateParagraphApiParagraphCreates a new paragraph.
CreatePatternFillApiFillCreates a pattern fill to apply to the object using the selected pattern as the object background.
CreatePresetColorApiPresetColorCreates a color selecting it from one of the available color presets.
CreateRGBColorApiRGBColorCreates an RGB color setting the appropriate values for the red, green and blue color components.
CreateRadialGradientFillApiFillCreates a radial gradient fill to apply to the object using the selected radial gradient as the object background.
CreateRunApiRunCreates a new smaller text block to be inserted to the current paragraph or table.
CreateSchemeColorApiSchemeColorCreates a complex color scheme selecting from one of the available schemes.
CreateSolidFillApiFillCreates a solid fill to apply to the object using a selected solid color as the object background.
CreateStrokeApiStrokeCreates a stroke adding shadows to the element.
CreateTextPrApiTextPrCreates the empty text properties.
FormatstringReturns a class formatted according to the instructions contained in the format expression.
GetActiveSheetApiWorksheetReturns an object that represents the active sheet.
GetAllCommentsApiComment[]Returns all comments from the current workbook including comments from all worksheets.
GetAllPivotTablesApiPivotTable[]Returns all pivot tables.
GetCommentByIdApiCommentReturns a comment from the current document by its ID.
GetCommentsApiComment[]Returns all comments related to the whole workbook.
GetDefNameApiNameReturns the ApiName object by the range name.
GetDocumentInfoobjectReturns the document information:\ -Application - the application the document has been created with.\ -CreatedRaw - the date and time when the file was created.\ -Created - the parsed date and time when the file was created.\ -LastModifiedRaw - the date and time when the file was last modified.\ -LastModified - the parsed date and time when the file was last modified.\ -LastModifiedBy - the name of the user who has made the latest change to the document.\ -Autrors - the persons who has created the file.\ -Title - this property allows you to simplify your documents classification.\ -Tags - this property allows you to simplify your documents classification.\ -Subject - this property allows you to simplify your documents classification.\ -Comment - this property allows you to simplify your documents classification.
GetFreezePanesTypeFreezePaneTypeReturns the freeze panes type.
GetFullNamestringReturns the full name of the currently opened file.
GetLocalenumberReturns the current locale ID.
GetMailMergeDatastring[][]Returns the mail merge data.
GetPivotByNameApiPivotTable | nullReturns a pivot table by its name, or null if it does not exist.
GetRangeApiRangeReturns the ApiRange object by the range reference.
GetReferenceStyleReferenceStyleReturns the cell reference style.
GetSelectionApiRangeReturns an object that represents the selected range.
GetSheetApiWorksheet | nullReturns an object that represents a sheet.
GetSheetsApiWorksheet[]Returns a sheet collection that represents all the sheets in the active workbook.
GetThemesColorsstring[]Returns a list of all the available theme colors for the spreadsheet.
GetWorksheetFunctionApiWorksheetFunctionReturns the ApiWorksheetFunction object.
InsertPivotExistingWorksheetApiPivotTableInserts the specified pivot table into an existing worksheet.
InsertPivotNewWorksheetApiPivotTableInserts the specified pivot table into a new worksheet.
IntersectApiRange | nullReturns the ApiRange object that represents the rectangular intersection of two or more ranges. If one or more ranges from a different worksheet are specified, an error will be returned.
RecalculateAllFormulasbooleanRecalculates all formulas in the active workbook.
RefreshAllPivotsNoneRefreshes all pivot tables.
RemoveCustomFunctionbooleanRemoves a custom function.
ReplaceTextSmartNoneReplaces each paragraph (or text in cell) in the select with the corresponding text from an array of strings.
SaveNoneSaves changes to the specified document.
SetFreezePanesTypeNoneSets a type to the freeze panes.
SetLocaleNoneSets a locale to the document.
SetReferenceStyleNoneSets the cell reference style.
SetThemeColorsbooleanSets the theme colors to the current spreadsheet.
attachEventNoneSubscribes to the specified event and calls the callback function when the event fires.
detachEventNoneUnsubscribes from the specified event.