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 . |
|
Binding | getRange() | Returns the range represented by the binding. |
getTable() | Returns the table represented by the binding. | |
getText() | Returns the text represented by the binding. | |
id | Represents the binding identifier. | |
type | Returns the type of the binding. | |
BindingCollection | count | Returns the number of bindings in the collection. |
getItem(id: string) | Gets a binding object by ID. | |
getItemAt(index: number) | Gets a binding object based on its position in the items array. | |
items | Gets the loaded child items in this collection. | |
Chart | axes | Represents chart axes. |
dataLabels | Represents the data labels on the chart. | |
delete() | Deletes the chart object. | |
format | Encapsulates the format properties for the chart area. | |
height | Specifies the height, in points, of the chart object. | |
left | The distance, in points, from the left side of the chart to the worksheet origin. | |
legend | Represents the legend for the chart. | |
name | Specifies the name of a chart object. | |
series | Represents either a single series or collection of series in the chart. | |
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. | |
title | Represents the title of the specified chart, including the text, visibility, position, and formatting of the title. | |
top | Specifies 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 | Specifies the width, in points, of the chart object. | |
ChartAreaFormat | fill | Represents the fill format of an object, which includes background formatting information. |
font | Represents the font attributes (font name, font size, color, etc.) for the current object. | |
ChartAxes | categoryAxis | Represents the category axis in a chart. |
seriesAxis | Represents the series axis of a 3-D chart. | |
valueAxis | Represents the value axis in an axis. | |
ChartAxis | format | Represents the formatting of a chart object, which includes line and font formatting. |
majorGridlines | Returns an object that represents the major gridlines for the specified axis. | |
majorUnit | Represents the interval between two major tick marks. | |
maximum | Represents the maximum value on the value axis. | |
minimum | Represents the minimum value on the value axis. | |
minorGridlines | Returns an object that represents the minor gridlines for the specified axis. | |
minorUnit | Represents the interval between two minor tick marks. | |
title | Represents the axis title. | |
ChartAxisFormat | font | Specifies the font attributes (font name, font size, color, etc.) for a chart axis element. |
line | Specifies chart line formatting. | |
ChartAxisTitle | format | Specifies the formatting of the chart axis title. |
text | Specifies the axis title. | |
visible | Specifies if the axis title is visible. | |
ChartAxisTitleFormat | font | Specifies the chart axis title's font attributes, such as font name, font size, or color, of the chart axis title object. |
ChartCollection | add(type: Excel.ChartType, sourceData: Range, seriesBy?: Excel.ChartSeriesBy) | Creates a new chart. |
count | Returns the number of charts in the worksheet. | |
getItem(name: string) | Gets a chart using its name. | |
getItemAt(index: number) | Gets a chart based on its position in the collection. | |
items | Gets the loaded child items in this collection. | |
ChartDataLabelFormat | fill | Represents the fill format of the current chart data label. |
font | Represents the font attributes (such as font name, font size, and color) for a chart data label. | |
ChartDataLabels | format | Specifies the format of chart data labels, which includes fill and font formatting. |
position | Value that represents the position of the data label. | |
separator | String representing the separator used for the data labels on a chart. | |
showBubbleSize | Specifies if the data label bubble size is visible. | |
showCategoryName | Specifies if the data label category name is visible. | |
showLegendKey | Specifies if the data label legend key is visible. | |
showPercentage | Specifies if the data label percentage is visible. | |
showSeriesName | Specifies if the data label series name is visible. | |
showValue | Specifies if the data label value is visible. | |
ChartFill | clear() | Clears 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. | |
ChartGridlines | format | Represents the formatting of chart gridlines. |
visible | Specifies if the axis gridlines are visible. | |
ChartGridlinesFormat | line | Represents chart line formatting. |
ChartLegend | format | Represents the formatting of a chart legend, which includes fill and font formatting. |
overlay | Specifies if the chart legend should overlap with the main body of the chart. | |
position | Specifies the position of the legend on the chart. | |
visible | Specifies if the chart legend is visible. | |
ChartLegendFormat | fill | Represents the fill format of an object, which includes background formatting information. |
font | Represents the font attributes such as font name, font size, and color of a chart legend. | |
ChartLineFormat | clear() | Clears 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. |
value | Returns the value of a chart point. | |
ChartPointFormat | fill | Represents the fill format of a chart, which includes background formatting information. |
ChartPointsCollection | count | Returns the number of chart points in the series. |
getItemAt(index: number) | Retrieve a point based on its position within the series. | |
items | Gets the loaded child items in this collection. | |
ChartSeries | format | Represents the formatting of a chart series, which includes fill and line formatting. |
name | Specifies the name of a series in a chart. | |
points | Returns a collection of all points in the series. | |
ChartSeriesCollection | count | Returns the number of series in the collection. |
getItemAt(index: number) | Retrieves a series based on its position in the collection. | |
items | Gets the loaded child items in this collection. | |
ChartSeriesFormat | fill | Represents the fill format of a chart series, which includes background formatting information. |
line | Represents line formatting. | |
ChartTitle | format | Represents the formatting of a chart title, which includes fill and font formatting. |
overlay | Specifies if the chart title will overlay the chart. | |
text | Specifies the chart's title text. | |
visible | Specifies if the chart title is visible. | |
ChartTitleFormat | fill | Represents the fill format of an object, which includes background formatting information. |
font | Represents the font attributes (such as font name, font size, and color) for an object. | |
NamedItem | getRange() | Returns the range object that is associated with the name. |
name | The name of the object. | |
type | Specifies the type of the value returned by the name's formula. | |
value | Represents the value computed by the name's formula. | |
visible | Specifies if the object is visible. | |
NamedItemCollection | getItem(name: string) | Gets a NamedItem object using its name. |
items | Gets the loaded child items in this collection. | |
Range | address | Specifies the range reference in A1-style. |
addressLocal | Represents the range reference for the specified range in the language of the user. | |
cellCount | Specifies the number of cells in the range. | |
clear(applyTo?: Excel.ClearApplyTo) | Clear range values and formatting, such as fill and border. | |
columnCount | Specifies the total number of columns in the range. | |
columnIndex | Specifies the column number of the first cell in the range. | |
delete(shift: Excel.DeleteShiftDirection) | Deletes the cells associated with the range. | |
format | Returns a format object, encapsulating the range's font, fill, borders, alignment, and other properties. | |
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. | |
getBoundingRect(anotherRange: Range | string) | Gets the smallest range object that encompasses the given ranges. | |
getCell(row: number, column: number) | Gets the range object containing the single cell based on row and column numbers. | |
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. | |
getLastColumn() | Gets the last column within the range. | |
getLastRow() | Gets the last row within the range. | |
getOffsetRange(rowOffset: number, columnOffset: number) | Gets an object which represents a range that's offset from the specified range. | |
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. | |
numberFormat | Represents Excel's number format code for the given range. | |
rowCount | Returns the total number of rows in the range. | |
rowIndex | Returns the row number of the first cell in the range. | |
select() | Selects the specified range in the Excel UI. | |
text | Text values of the specified range. | |
valueTypes | Specifies the type of data in each cell. | |
values | Represents the raw values of the specified range. | |
worksheet | The worksheet containing the current range. | |
RangeBorder | color | HTML color code representing the color of the border line, in 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. | |
style | One of the constants of line style specifying the line style for the border. | |
weight | Specifies the weight of the border around a range. | |
RangeBorderCollection | count | Number of border objects in the collection. |
getItem(index: Excel.BorderIndex) | Gets a border object using its name. | |
getItemAt(index: number) | Gets a border object using its index. | |
items | Gets the loaded child items in this collection. | |
RangeFill | clear() | Resets the range background. |
color | HTML color code representing the color of the background, in the form #RRGGBB (e.g., "FFA500"), or as a named HTML color (e.g., "orange") | |
RangeFont | bold | Represents the bold status of the font. |
color | HTML color code representation of the text color (e.g., #FF0000 represents Red). | |
italic | Specifies the italic status of the font. | |
name | Font name (e.g., "Calibri"). | |
size | Font size. | |
underline | Type of underline applied to the font. | |
RangeFormat | borders | Collection of border objects that apply to the overall range. |
fill | Returns the fill object defined on the overall range. | |
font | Returns the font object defined on the overall range. | |
horizontalAlignment | Represents the horizontal alignment for the specified object. | |
verticalAlignment | Represents the vertical alignment for the specified object. | |
wrapText | Specifies if Excel wraps the text in the object. | |
Table | columns | Represents a collection of all the columns in the 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 the header row of the table. | |
getRange() | Gets the range object associated with the entire table. | |
getTotalRowRange() | Gets the range object associated with the totals row of the table. | |
id | Returns a value that uniquely identifies the table in a given workbook. | |
name | Name of the table. | |
rows | Represents a collection of all the rows in the table. | |
showHeaders | Specifies if the header row is visible. | |
showTotals | Specifies if the total row is visible. | |
style | Constant value that represents the table style. | |
TableCollection | add(address: Range | string, hasHeaders: boolean) | Creates a new table. |
count | Returns the number of tables in the workbook. | |
getItem(key: string) | Gets a table by name or ID. | |
getItemAt(index: number) | Gets a table based on its position in the collection. | |
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. | |
id | Returns a unique key that identifies the column within the table. | |
index | Returns the index number of the column within the columns collection of the table. | |
name | Specifies the name of the table column. | |
values | Represents the raw values of the specified range. | |
TableColumnCollection | add(index?: number, values?: Array<Array<boolean | string | number>> | boolean | string | number, name?: string) | Adds a new column to the table. |
count | Returns the number of columns in 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. | |
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. | |
values | Represents the raw values of the specified range. | |
TableRowCollection | add(index?: number, values?: Array<Array<boolean | string | number>> | boolean | string | number, alwaysInsert?: boolean) | Adds one or more rows to the table. |
count | Returns the number of rows in the table. | |
getItemAt(index: number) | Gets a row based on its position in the collection. | |
items | Gets the loaded child items in this collection. | |
Workbook | application | Represents the Excel application instance that contains this workbook. |
bindings | Represents a collection of bindings that are part of the workbook. | |
getSelectedRange() | Gets the currently selected single range from the workbook. | |
names | Represents a collection of workbook-scoped named items (named ranges and constants). | |
tables | Represents a collection of tables associated with the workbook. | |
worksheets | Represents a collection of worksheets associated with the workbook. | |
Worksheet | activate() | Activate the worksheet in the Excel UI. |
charts | Returns a collection of charts that are part of the worksheet. | |
delete() | Deletes the worksheet from the workbook. | |
getCell(row: number, column: number) | Gets the Range object containing the single cell based on row and column numbers. |
|
getRange(address?: string) | Gets the Range object, representing a single rectangular block of cells, specified by the address or name. |
|
id | Returns a value that uniquely identifies the worksheet in a given workbook. | |
name | The display name of the worksheet. | |
position | The zero-based position of the worksheet within the workbook. | |
tables | Collection of tables that are part of the worksheet. | |
visibility | The visibility of the worksheet. | |
WorksheetCollection | add(name?: string) | Adds a new worksheet to the workbook. |
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
Współpracuj z nami w serwisie GitHub
Źródło tej zawartości można znaleźć w witrynie GitHub, gdzie można również tworzyć i przeglądać problemy i żądania ściągnięcia. Więcej informacji znajdziesz w naszym przewodniku dla współtwórców.