Support for Excel 2010 has ended. Learn what end of support means and how to upgrade to Microsoft 365. Get the details. Microsoft Excel is one of the most versatile and useful programs in the Office suite. It doesn’t matter if you need Excel templates for budgeting the next fiscal year, tracking your business inventory, planning out meals, or creating a fantasy football draft sheet, there are plenty of Microsoft Excel templates for you.
-->This site contains the documentation for Office 365 REST APIs exposed on the OneNote and Outlook endpoints. The documentation is no longer actively updated. It is here for your reference, in case you have already included any of the API in your project.
Office 365 services, such as OneNote, Outlook, Excel, OneDrive, Microsoft Teams, Planner, and SharePoint, are now exposed in Microsoft Graph. Microsoft Graph is a unified API endpoint for accessing data across Microsoft 365, which includes Office 365, Enterprise Mobility, and Security and Windows services. It provides a simplified developer experience, with one endpoint and a single authentication token that gives your app access to data across all these services.
Our recommendation:
With Microsoft Graph, you can access Office 365 data and more, from solutions across mobile, web, and desktop platforms. So whether you're building web applications by using .NET, PHP, Java, Python, or Ruby on Rails, or creating apps for the Universal Windows Platform (UWP), iOS, Android, or on another device platform, it's your choice.
This article describes how to use the Excel JavaScript API to build add-ins for Excel 2016 or later. It introduces core concepts that are fundamental to using the API and provides guidance for performing specific tasks such as reading or writing to a large range, updating all cells in range, and more.
Microsoft edge for ubuntu 18.04. Important
See Using the application-specific API model to learn about the asynchronous nature of the Excel APIs and how they work with the workbook.
An Excel add-in interacts with objects in Excel by using the Office JavaScript API, which includes two JavaScript object models:
Serum dnb downloadtreecost. Excel JavaScript API: Introduced with Office 2016, the Excel JavaScript API provides strongly-typed objects that you can use to access worksheets, ranges, tables, charts, and more.
Common APIs: Introduced with Office 2013, the Common API can be used to access features such as UI, dialogs, and client settings that are common across multiple types of Office applications.
While you'll likely use the Excel JavaScript API to develop the majority of functionality in add-ins that target Excel 2016 or later, you'll also use objects in the Common API. For example:
Context
object represents the runtime environment of the add-in and provides access to key objects of the API. It consists of workbook configuration details such as contentLanguage
and officeTheme
and also provides information about the add-in's runtime environment such as host
and platform
. Additionally, it provides the requirements.isSetSupported()
method, which you can use to check whether the specified requirement set is supported by the Excel application where the add-in is running.Document
object provides the getFileAsync()
method, which you can use to download the Excel file where the add-in is running.The following image illustrates when you might use the Excel JavaScript API or the Common APIs.
To understand the Excel APIs, you must understand how the components of a workbook are related to one another.
Note
The Excel JavaScript API doesn't have a 'Cell' object or class. Instead, the Excel JavaScript API defines all Excel cells as Range
objects. An individual cell in the Excel UI translates to a Range
object with one cell in the Excel JavaScript API. A single Range
object can also contain multiple contiguous cells. See Work with cells using the Excel JavaScript API to learn more.
A range is a group of contiguous cells in the workbook. Add-ins typically use A1-style notation (e.g. B3 for the single cell in column B and row 3 or C2:F4 for the cells from columns C through F and rows 2 through 4) to define ranges.
Ranges have three core properties: values
, formulas
, and format
. These properties get or set the cell values, formulas to be evaluated, and the visual formatting of the cells.
The following sample shows how to create sales records. This function uses Range
objects to set the values, formulas, and formats.
This sample creates the following data in the current worksheet:
For more information, see Set and get range values, text, or formulas using the Excel JavaScript API.
The Excel JavaScript APIs can create and manipulate the data structures and visualizations within Excel. Tables and charts are two of the more commonly used objects, but the APIs support PivotTables, shapes, images, and more.
Create tables by using data-filled ranges. Formatting and table controls (such as filters) are automatically applied to the range.
The following sample creates a table using the ranges from the previous sample.
Using this sample code on the worksheet with the previous data creates the following table:
For more information, see Work with tables using the Excel JavaScript API.
Create charts to visualize the data in a range. The APIs support dozens of chart varieties, each of which can be customized to suit your needs.
The following sample creates a simple column chart for three items and places it 100 pixels below the top of the worksheet.
Running this sample on the worksheet with the previous table creates the following chart:
For more information, see Work with charts using the Excel JavaScript API.