Autofit a column on an Excel worksheet

This REST API autofits a column (or a range of columns) on an Excel worksheet.

REST API

POST http://api.aspose.cloud/v3.0/cells/{name}/worksheets/{sheetName}/autofitcolumns

Request parameters

Parameter Name Type Location Description
name string path The name of the Excel file.
sheetName string path The name of the worksheet.
firstColumn integer query Zero‑based index of the first column to autofit.
lastColumn integer query Zero‑based index of the last column to autofit.
autoFitterOptions object body Options that control the autofit behavior (see AutoFitterOptions).
firstRow integer query Zero‑based index of the first row considered when calculating column width.
lastRow integer query Zero‑based index of the last row considered when calculating column width.
folder string query The folder in storage where the file is located.
storageName string query The name of the storage service.

The OpenAPI Specification defines a publicly accessible programming interface and lets you perform REST interactions directly from a web browser.

You can use the cURL command‑line tool to call Aspose.Cells Cloud services. The example below demonstrates how to invoke the autofit‑column endpoint.

Cloud SDK Family

Using an SDK is the fastest way to integrate the API into your application. SDKs handle low‑level details so you can focus on business logic. See the GitHub repository for the complete list of Aspose.Cells Cloud SDKs.

The following code examples demonstrate how to call the autofit‑column endpoint with various SDKs: