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.
AddCustomFunctionLibraryNoneRegisters a new custom functions library (see the SetCustomFunctions plugin method).
AddDefNamebooleanAdds a new name to a range of cells.
AddSheetApiWorksheetCreates a new worksheet. The new worksheet becomes the active sheet.
CentimetersToPointsnumberConverts centimeters to points.
ClearCustomFunctionsbooleanClears all custom functions.
ColorApiColorCreates an ApiColor from a universal input. The method recognizes several call signatures and either delegates to a narrower factory or constructs an ApiColor directly.
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.
CreateCustomGeometryApiGeometryCreates a new custom geometry.
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.
CreateNewHistoryPointbooleanCreates 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.
CreatePresetGeometryApiGeometry | nullCreates a geometry using one of the available preset shapes.
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.
EmusToMillimetersmmConverts English Metric Units (EMUs) to millimeters.
EmusToPointsnumberConverts EMUs (English Metric Units) to points.
FormatstringReturns a class formatted according to the instructions contained in the format expression.
GetActiveSheetApiWorksheetReturns an object that represents the active sheet.
GetActiveWorkbookApiWorkbookReturns an object that represents the active workbook.
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.
GetCoreApiCoreReturns the core properties interface for the workbook.
GetCustomPropertiesApiCustomPropertiesReturns the workbook custom properties.
GetDefNameApiNameReturns the ApiName object by the range name.
GetDefNamesApiName[]Returns an array of all ApiName objects defined in the workbook, across all scopes (workbook-level and sheet-level).
GetDocumentInfoobjectReturns the document information:
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.
HexColorApiColorCreates a color from a HEX string.
InchesToPointsnumberConverts inches to points.
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.
LinesToPointsnumberConverts lines to points (1 line = 12 points).
MillimetersToEmusEMUConverts millimeters to English Metric Units (EMUs).
MillimetersToPixelsnumberConverts millimeters to pixels.
MillimetersToPointsnumberConverts millimeters to points.
PicasToPointsnumberConverts picas to points.
PixelsToEmusnumberConverts pixels to EMUs (English Metric Units).
PixelsToPointsnumberConverts pixels to points.
PointsToCentimetersnumberConverts points to centimeters.
PointsToEmusnumberConverts points to EMUs (English Metric Units).
PointsToInchesnumberConverts points to inches.
PointsToLinesnumberConverts points to lines (1 line = 12 points).
PointsToMillimetersnumberConverts points to millimeters.
PointsToPicasnumberConverts points to picas (1 pica = 12 points).
PointsToPixelsnumberConverts points to pixels.
PointsToTwipsnumberConverts points to twips.
RGBApiColorCreates an RGB color from red, green and blue components.
RGBAApiColorCreates an RGBA color from red, green, blue and alpha components.
RecalculateAllFormulasbooleanRecalculates all formulas in the active workbook.
RefreshAllPivotsNoneRefreshes all pivot tables.
RemoveCustomFunctionbooleanRemoves a custom function.
ReplaceTextSmartbooleanReplaces each paragraph (or text in cell) in the select with the corresponding text from an array of strings.
SavebooleanSaves changes to the specified document.
SetFreezePanesTypeNoneSets a type to the freeze panes.
SetLocalebooleanSets a locale to the document.
SetReferenceStyleNoneSets the cell reference style.
SetThemeColorsbooleanSets the theme colors to the current spreadsheet.
ThemeColorApiColorCreates a theme color.
TwipsToPointsnumberConverts twips to points.
attachEventNoneSubscribes to the specified event and calls the callback function when the event fires.
detachEventNoneUnsubscribes from the specified event.