Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
241 lines (233 sloc) 35.4 KB
title description ms.date ms.prod localization_priority
Excel JavaScript API requirement set 1.1
Details about the ExcelApi 1.1 requirement set
07/26/2019
excel
Normal

Excel JavaScript API requirement set 1.1

Excel JavaScript API 1.1 is the first version of the API. It is the only Excel-specific requirement set supported by Excel 2016.

API list

The following table lists the APIs in Excel JavaScript API requirement set 1.1. To view API reference documentation for all APIs supported by Excel JavaScript API requirement set 1.1, see Excel APIs in requirement set 1.1.

Class Fields Description
Application calculate(calculationType: Excel.CalculationType) Recalculate all currently opened workbooks in Excel.
calculationMode Returns the calculation mode used in the workbook, as defined by the constants in Excel.CalculationMode. Possible values are: Automatic, where Excel controls recalculation; AutomaticExceptTables, where Excel controls recalculation but ignores changes in tables; Manual, where calculation is done when the user requests it.
Binding getRange() Returns the range represented by the binding. Will throw an error if binding is not of the correct type.
getTable() Returns the table represented by the binding. Will throw an error if binding is not of the correct type.
getText() Returns the text represented by the binding. Will throw an error if binding is not of the correct type.
id Represents binding identifier. Read-only.
type Returns the type of the binding. See Excel.BindingType for details. Read-only.
BindingCollection getItem(id: string) Gets a binding object by ID.
getItemAt(index: number) Gets a binding object based on its position in the items array.
count Returns the number of bindings in the collection. Read-only.
items Gets the loaded child items in this collection.
Chart delete() Deletes the chart object.
height Represents the height, in points, of the chart object.
left The distance, in points, from the left side of the chart to the worksheet origin.
name Represents the name of a chart object.
axes Represents chart axes. Read-only.
dataLabels Represents the datalabels on the chart. Read-only.
format Encapsulates the format properties for the chart area. Read-only.
legend Represents the legend for the chart. Read-only.
series Represents either a single series or collection of series in the chart. Read-only.
title Represents the title of the specified chart, including the text, visibility, position, and formatting of the title. Read-only.
setData(sourceData: Range, seriesBy?: Excel.ChartSeriesBy) Resets the source data for the chart.
setPosition(startCell: Range | string, endCell?: Range | string) Positions the chart relative to cells on the worksheet.
top Represents the distance, in points, from the top edge of the object to the top of row 1 (on a worksheet) or the top of the chart area (on a chart).
width Represents the width, in points, of the chart object.
ChartAreaFormat fill Represents the fill format of an object, which includes background formatting information. Read-only.
font Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only.
ChartAxes categoryAxis Represents the category axis in a chart. Read-only.
seriesAxis Represents the series axis of a 3-dimensional chart. Read-only.
valueAxis Represents the value axis in an axis. Read-only.
ChartAxis majorUnit Represents the interval between two major tick marks. Can be set to a numeric value or an empty string. The returned value is always a number.
maximum Represents the maximum value on the value axis. Can be set to a numeric value or an empty string (for automatic axis values). The returned value is always a number.
minimum Represents the minimum value on the value axis. Can be set to a numeric value or an empty string (for automatic axis values). The returned value is always a number.
minorUnit Represents the interval between two minor tick marks. Can be set to a numeric value or an empty string (for automatic axis values). The returned value is always a number.
format Represents the formatting of a chart object, which includes line and font formatting. Read-only.
majorGridlines Returns a Gridlines object that represents the major gridlines for the specified axis. Read-only.
minorGridlines Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only.
title Represents the axis title. Read-only.
ChartAxisFormat font Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only.
line Represents chart line formatting. Read-only.
ChartAxisTitle format Represents the formatting of chart axis title. Read-only.
text Represents the axis title.
visible A boolean that specifies the visibility of an axis title.
ChartAxisTitleFormat font Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only.
ChartCollection add(type: Excel.ChartType, sourceData: Range, seriesBy?: Excel.ChartSeriesBy) Creates a new chart.
getItem(name: string) Gets a chart using its name. If there are multiple charts with the same name, the first one will be returned.
getItemAt(index: number) Gets a chart based on its position in the collection.
count Returns the number of charts in the worksheet. Read-only.
items Gets the loaded child items in this collection.
ChartDataLabelFormat fill Represents the fill format of the current chart data label. Read-only.
font Represents the font attributes (font name, font size, color, etc.) for a chart data label. Read-only.
ChartDataLabels position DataLabelPosition value that represents the position of the data label. See Excel.ChartDataLabelPosition for details.
format Represents the format of chart data labels, which includes fill and font formatting. Read-only.
separator String representing the separator used for the data labels on a chart.
showBubbleSize Boolean value representing if the data label bubble size is visible or not.
showCategoryName Boolean value representing if the data label category name is visible or not.
showLegendKey Boolean value representing if the data label legend key is visible or not.
showPercentage Boolean value representing if the data label percentage is visible or not.
showSeriesName Boolean value representing if the data label series name is visible or not.
showValue Boolean value representing if the data label value is visible or not.
ChartFill clear() Clear the fill color of a chart element.
setSolidColor(color: string) Sets the fill formatting of a chart element to a uniform color.
ChartFont bold Represents the bold status of font.
color HTML color code representation of the text color. E.g. #FF0000 represents Red.
italic Represents the italic status of the font.
name Font name (e.g. "Calibri")
size Size of the font (e.g. 11)
underline Type of underline applied to the font. See Excel.ChartUnderlineStyle for details.
ChartGridlines format Represents the formatting of chart gridlines. Read-only.
visible Boolean value representing if the axis gridlines are visible or not.
ChartGridlinesFormat line Represents chart line formatting. Read-only.
ChartLegend overlay Boolean value for whether the chart legend should overlap with the main body of the chart.
position Represents the position of the legend on the chart. See Excel.ChartLegendPosition for details.
format Represents the formatting of a chart legend, which includes fill and font formatting. Read-only.
visible A boolean value the represents the visibility of a ChartLegend object.
ChartLegendFormat fill Represents the fill format of an object, which includes background formatting information. Read-only.
font Represents the font attributes such as font name, font size, color, etc. of a chart legend. Read-only.
ChartLineFormat clear() Clear the line format of a chart element.
color HTML color code representing the color of lines in the chart.
ChartPoint format Encapsulates the format properties chart point. Read-only.
value Returns the value of a chart point. Read-only.
ChartPointFormat fill Represents the fill format of a chart, which includes background formatting information. Read-only.
ChartPointsCollection getItemAt(index: number) Retrieve a point based on its position within the series.
count Returns the number of chart points in the series. Read-only.
items Gets the loaded child items in this collection.
ChartSeries name Represents the name of a series in a chart.
format Represents the formatting of a chart series, which includes fill and line formatting. Read-only.
points Represents a collection of all points in the series. Read-only.
ChartSeriesCollection getItemAt(index: number) Retrieves a series based on its position in the collection.
count Returns the number of series in the collection. Read-only.
items Gets the loaded child items in this collection.
ChartSeriesFormat fill Represents the fill format of a chart series, which includes background formatting information. Read-only.
line Represents line formatting. Read-only.
ChartTitle overlay Boolean value representing if the chart title will overlay the chart or not.
format Represents the formatting of a chart title, which includes fill and font formatting. Read-only.
text Represents the title text of a chart.
visible A boolean value the represents the visibility of a chart title object.
ChartTitleFormat fill Represents the fill format of an object, which includes background formatting information. Read-only.
font Represents the font attributes (font name, font size, color, etc.) for an object. Read-only.
NamedItem getRange() Returns the range object that is associated with the name. Throws an error if the named item's type is not a range.
name The name of the object. Read-only.
type Indicates the type of the value returned by the name's formula. See Excel.NamedItemType for details. Read-only.
value Represents the value computed by the name's formula. For a named range, will return the range address. Read-only.
visible Specifies whether the object is visible or not.
NamedItemCollection getItem(name: string) Gets a NamedItem object using its name.
items Gets the loaded child items in this collection.
Range clear(applyTo?: Excel.ClearApplyTo) Clear range values, format, fill, border, etc.
delete(shift: Excel.DeleteShiftDirection) Deletes the cells associated with the range.
formulas Represents the formula in A1-style notation.
formulasLocal Represents the formula in A1-style notation, in the user's language and number-formatting locale. For example, the English "=SUM(A1, 1.5)" formula would become "=SUMME(A1; 1,5)" in German.
getBoundingRect(anotherRange: Range | string) Gets the smallest range object that encompasses the given ranges. For example, the GetBoundingRect of "B2:C5" and "D10:E15" is "B2:E15".
getCell(row: number, column: number) Gets the range object containing the single cell based on row and column numbers. The cell can be outside the bounds of its parent range, so long as it stays within the worksheet grid. The returned cell is located relative to the top left cell of the range.
getColumn(column: number) Gets a column contained in the range.
getEntireColumn() Gets an object that represents the entire column of the range (for example, if the current range represents cells "B4:E11", its getEntireColumn is a range that represents columns "B:E").
getEntireRow() Gets an object that represents the entire row of the range (for example, if the current range represents cells "B4:E11", its GetEntireRow is a range that represents rows "4:11").
getIntersection(anotherRange: Range | string) Gets the range object that represents the rectangular intersection of the given ranges.
getLastCell() Gets the last cell within the range. For example, the last cell of "B2:D5" is "D5".
getLastColumn() Gets the last column within the range. For example, the last column of "B2:D5" is "D2:D5".
getLastRow() Gets the last row within the range. For example, the last row of "B2:D5" is "B5:D5".
getOffsetRange(rowOffset: number, columnOffset: number) Gets an object which represents a range that's offset from the specified range. The dimension of the returned range will match this range. If the resulting range is forced outside the bounds of the worksheet grid, an error will be thrown.
getRow(row: number) Gets a row contained in the range.
insert(shift: Excel.InsertShiftDirection) Inserts a cell or a range of cells into the worksheet in place of this range, and shifts the other cells to make space. Returns a new Range object at the now blank space.
numberFormat Represents Excel's number format code for the given range.
address Represents the range reference in A1-style. Address value will contain the Sheet reference (e.g. "Sheet1!A1:B4"). Read-only.
addressLocal Represents range reference for the specified range in the language of the user. Read-only.
cellCount Number of cells in the range. This API will return -1 if the cell count exceeds 2^31-1 (2,147,483,647). Read-only.
columnCount Represents the total number of columns in the range. Read-only.
columnIndex Represents the column number of the first cell in the range. Zero-indexed. Read-only.
format Returns a format object, encapsulating the range's font, fill, borders, alignment, and other properties. Read-only.
rowCount Returns the total number of rows in the range. Read-only.
rowIndex Returns the row number of the first cell in the range. Zero-indexed. Read-only.
text Text values of the specified range. The Text value will not depend on the cell width. The # sign substitution that happens in Excel UI will not affect the text value returned by the API. Read-only.
valueTypes Represents the type of data of each cell. Read-only.
worksheet The worksheet containing the current range. Read-only.
select() Selects the specified range in the Excel UI.
values Represents the raw values of the specified range. The data returned could be of type string, number, or a boolean. Cells that contain an error will return the error string.
RangeBorder color HTML color code representing the color of the border line, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange").
sideIndex Constant value that indicates the specific side of the border. See Excel.BorderIndex for details. Read-only.
style One of the constants of line style specifying the line style for the border. See Excel.BorderLineStyle for details.
weight Specifies the weight of the border around a range. See Excel.BorderWeight for details.
RangeBorderCollection getItem(index: Excel.BorderIndex) Gets a border object using its name.
getItemAt(index: number) Gets a border object using its index.
count Number of border objects in the collection. Read-only.
items Gets the loaded child items in this collection.
RangeFill clear() Resets the range background.
color HTML color code representing the color of the border line, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange")
RangeFont bold Represents the bold status of font.
color HTML color code representation of the text color. E.g. #FF0000 represents Red.
italic Represents the italic status of the font.
name Font name (e.g. "Calibri")
size Font size.
underline Type of underline applied to the font. See Excel.RangeUnderlineStyle for details.
RangeFormat horizontalAlignment Represents the horizontal alignment for the specified object. See Excel.HorizontalAlignment for details.
borders Collection of border objects that apply to the overall range. Read-only.
fill Returns the fill object defined on the overall range. Read-only.
font Returns the font object defined on the overall range. Read-only.
verticalAlignment Represents the vertical alignment for the specified object. See Excel.VerticalAlignment for details.
wrapText Indicates if Excel wraps the text in the object. A null value indicates that the entire range doesn't have uniform wrap setting
Table delete() Deletes the table.
getDataBodyRange() Gets the range object associated with the data body of the table.
getHeaderRowRange() Gets the range object associated with header row of the table.
getRange() Gets the range object associated with the entire table.
getTotalRowRange() Gets the range object associated with totals row of the table.
name Name of the table.
columns Represents a collection of all the columns in the table. Read-only.
id Returns a value that uniquely identifies the table in a given workbook. The value of the identifier remains the same even when the table is renamed. Read-only.
rows Represents a collection of all the rows in the table. Read-only.
showHeaders Indicates whether the header row is visible or not. This value can be set to show or remove the header row.
showTotals Indicates whether the total row is visible or not. This value can be set to show or remove the total row.
style Constant value that represents the Table style. Possible values are: TableStyleLight1 thru TableStyleLight21, TableStyleMedium1 thru TableStyleMedium28, TableStyleStyleDark1 thru TableStyleStyleDark11. A custom user-defined style present in the workbook can also be specified.
TableCollection add(address: Range | string, hasHeaders: boolean) Create a new table. The range object or source address determines the worksheet under which the table will be added. If the table cannot be added (e.g., because the address is invalid, or the table would overlap with another table), an error will be thrown.
getItem(key: string) Gets a table by Name or ID.
getItemAt(index: number) Gets a table based on its position in the collection.
count Returns the number of tables in the workbook. Read-only.
items Gets the loaded child items in this collection.
TableColumn delete() Deletes the column from the table.
getDataBodyRange() Gets the range object associated with the data body of the column.
getHeaderRowRange() Gets the range object associated with the header row of the column.
getRange() Gets the range object associated with the entire column.
getTotalRowRange() Gets the range object associated with the totals row of the column.
name Represents the name of the table column.
id Returns a unique key that identifies the column within the table. Read-only.
index Returns the index number of the column within the columns collection of the table. Zero-indexed. Read-only.
values Represents the raw values of the specified range. The data returned could be of type string, number, or a boolean. Cells that contain an error will return the error string.
TableColumnCollection add(index?: number, values?: Array<Array<boolean | string | number>> | boolean | string | number, name?: string) Adds a new column to the table.
getItem(key: number | string) Gets a column object by Name or ID.
getItemAt(index: number) Gets a column based on its position in the collection.
count Returns the number of columns in the table. Read-only.
items Gets the loaded child items in this collection.
TableRow delete() Deletes the row from the table.
getRange() Returns the range object associated with the entire row.
index Returns the index number of the row within the rows collection of the table. Zero-indexed. Read-only.
values Represents the raw values of the specified range. The data returned could be of type string, number, or a boolean. Cells that contain an error will return the error string.
TableRowCollection add(index?: number, values?: Array<Array<boolean | string | number>> | boolean | string | number) Adds one or more rows to the table. The return object will be the top of the newly added row(s).
getItemAt(index: number) Gets a row based on its position in the collection.
count Returns the number of rows in the table. Read-only.
items Gets the loaded child items in this collection.
Workbook getSelectedRange() Gets the currently selected single range from the workbook. If there are multiple ranges selected, this method will throw an error.
application Represents the Excel application instance that contains this workbook. Read-only.
bindings Represents a collection of bindings that are part of the workbook. Read-only.
names Represents a collection of workbook scoped named items (named ranges and constants). Read-only.
tables Represents a collection of tables associated with the workbook. Read-only.
worksheets Represents a collection of worksheets associated with the workbook. Read-only.
Worksheet activate() Activate the worksheet in the Excel UI.
delete() Deletes the worksheet from the workbook. Note that if the worksheet's visibility is set to "VeryHidden", the delete operation will fail with a GeneralException.
getCell(row: number, column: number) Gets the range object containing the single cell based on row and column numbers. The cell can be outside the bounds of its parent range, so long as it stays within the worksheet grid.
getRange(address?: string) Gets the range object, representing a single rectangular block of cells, specified by the address or name.
name The display name of the worksheet.
position The zero-based position of the worksheet within the workbook.
charts Returns collection of charts that are part of the worksheet. Read-only.
id Returns a value that uniquely identifies the worksheet in a given workbook. The value of the identifier remains the same even when the worksheet is renamed or moved. Read-only.
tables Collection of tables that are part of the worksheet. Read-only.
visibility The Visibility of the worksheet.
WorksheetCollection add(name?: string) Adds a new worksheet to the workbook. The worksheet will be added at the end of existing worksheets. If you wish to activate the newly added worksheet, call ".activate() on it.
getActiveWorksheet() Gets the currently active worksheet in the workbook.
getItem(key: string) Gets a worksheet object using its Name or ID.
items Gets the loaded child items in this collection.

See also

You can’t perform that action at this time.