Worksheet: Range
-
Article
-
- 2 minutes to read
-
Namespace: microsoft.graph
Gets the range object specified by the address or name.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
| Permission type |
Permissions (from least to most privileged) |
| Delegated (work or school account) |
Files.ReadWrite |
| Delegated (personal Microsoft account) |
Not supported. |
| Application |
Not supported. |
HTTP request
GET /me/drive/items/{id}/workbook/worksheets/{id|name}/range
GET /me/drive/root:/{item-path}:/workbook/worksheets/{id|name}/range
| Name |
Description |
| Authorization |
Bearer {token}. Required. |
| Workbook-Session-Id |
Workbook session Id that determines if changes are persisted or not. Optional. |
Function parameters
| Parameter |
Type |
Description |
| address |
string |
Optional. The address or the name of the range. If not specified, the entire worksheet range is returned. |
Response
If successful, this method returns 200 OK response code and Range object in the response body.
Example
Here is an example of how to call this API.
Request
Here is an example of the request.
GET https://graph.microsoft.com/v1.0/me/drive/items/{id}/workbook/worksheets/{id|name}/range(address='A1:B2')
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var workbookRange = await graphClient.Me.Drive.Items["{driveItem-id}"].Workbook.Worksheets["{workbookWorksheet-id}"]
.Range("A1:B2")
.Request()
.GetAsync();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
const options = {
authProvider,
};
const client = Client.init(options);
let workbookRange = await client.api('/me/drive/items/{id}/workbook/worksheets/{id|name}/range(address='A1:B2')')
.get();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
WorkbookRange workbookRange = graphClient.me().drive().items("{id}").workbook().worksheets("{id|name}")
.range(WorkbookWorksheetRangeParameterSet
.newBuilder()
.withAddress("A1:B2")
.build())
.buildRequest()
.get();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Response
Here is an example of the response. Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-type: application/json
{
"address": "address-value",
"addressLocal": "addressLocal-value",
"cellCount": 99,
"columnCount": 99,
"columnIndex": 99,
"valueTypes": "valueTypes-value"
}
If the optional address parameter is not specified, this function returns the entire worksheet range.
Request
GET https://graph.microsoft.com/v1.0/me/drive/items/{id}/workbook/worksheets/{id|name}/range
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var workbookRange = await graphClient.Me.Drive.Items["{driveItem-id}"].Workbook.Worksheets["{workbookWorksheet-id}"]
.Range()
.Request()
.GetAsync();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
const options = {
authProvider,
};
const client = Client.init(options);
let workbookRange = await client.api('/me/drive/items/{id}/workbook/worksheets/{id|name}/range')
.get();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
WorkbookRange workbookRange = graphClient.me().drive().items("{id}").workbook().worksheets("{id|name}")
.range()
.buildRequest()
.get();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Response
HTTP/1.1 200 OK
Content-type: application/json
{
"address": "address-value",
"addressLocal": "addressLocal-value",
"cellCount": 99,
"columnCount": 99,
"columnIndex": 99,
"valueTypes": "valueTypes-value"
}