How to Move Worksheets in Excel - Rearrange Sheet Order & Position
Programmatically move worksheets within Excel workbooks using Aspose.Cells Cloud API. Change sheet positions, reorder tabs, and optimize workbook structure through RESTful API calls. Perfect for automating spreadsheet organization and creating standardized workbook layouts.
Move worksheet from Spreadsheet API
API Endpoint
PUT http://api.aspose.cloud/v4.0/cells/spreadsheet/move/worksheet
Request Parameters:
| Parameter Name | Type | Path/Query String/HTTPBody | Description |
|---|---|---|---|
| Spreadsheet | File | FormData | Required. The source Excel workbook file (.xlsx, .xls, etc.) containing the worksheet to be repositioned. |
| worksheet | String | Query | Required. The exact name of the worksheet to move (e.g., Summary, RawData_2024). |
| position | Integer | Query | Required. The new zero-based index position for the worksheet. For example, 0 moves it to the first position, 2 moves it to become the third sheet. |
| outPath | String | Query | Optional. The target folder path in cloud storage where the reorganized workbook will be saved. If null or omitted, it may default to the source file’s directory. |
| outStorageName | String | Query | Required. The name identifier of your configured cloud storage service (e.g., TeamDrive) where the output file will be stored. |
| region | String | Query | Optional. The locale setting (e.g., es-MX) to apply, which may influence certain formatting rules during the save operation. |
| password | String | Query | Optional. The decryption password required to open and modify a password-protected workbook. Omit if the file is not encrypted. |
Response
[
{
"Name": "ResponseFile",
"DataType": {
"Identifier": "File",
"Reference": "Stream"
}
}
]
Error Codes
- 400 Bad Request: Invalid Aspose.Cells Cloud API URI.
- 401 Unauthorized: Invalid access token. Or invalid client id and secret.
- 404 Not Found: The spreadsheet file not accessible.
- 500 Server Error: The spreadsheet has encountered an anomaly in obtaining calculation data.
Where should we use the Move Worksheet in Spreadsheet API?
- Standardized Report Generation: After the monthly or quarterly reports are automatically generated, according to the company’s standard template requirements, the
SummaryorExecutive Overviewworksheet is automatically moved to the top of the workbook to ensure that the core conclusions are presented when the file is opened. - Data Processing Pipeline: After processing the raw worksheets from different data sources in the ETL process, the
Processed_Dataworksheet that has been cleaned and transformed is moved to a logical position in the workbook (such as in the middle), forming a clear process structure with the original data and analysis results. - User Customized File Delivery: After the user selects the preferred layout through the configuration interface (such as placing the chart page at the top), the system automatically rearranges the worksheet order in the workbook according to the selection and delivers the personalized file.
Why should you use the Move Worksheet in Spreadsheet API?
- Developer-Friendly: Aspose.Cells Cloud offers SDK libraries in multiple languages, enabling quick development and comes with comprehensive documentation. Compared to building custom chart rendering solutions, this significantly reduces the development workload.
- Reduced Labor Costs: Reduced the need for positions dedicated to document consolidation.
- Pay-per-use: No upfront investment, only pay for API calls actually used.
- Zero Maintenance Costs: No need to maintain servers, update software, or deal with compatibility issues.
How to Use the Move Worksheet in Spreadsheet API with SDKs
Move Worksheet in Spreadsheet API Specification
The Move Worksheet in Spreadsheet API Specification provides a publicly accessible programming interface to facilitate direct REST interactions from a web browser.
Use Aspose.Cells Cloud SDKs
Using the SDK is the fastest way to develop, as it abstracts away the low-level details, allowing you to move worksheet in the spreadsheet with short code. Please check out the GitHub repository for a complete list of Aspose.Cells Cloud SDKs. The following code examples demonstrate how to call the Aspose.Cells web services using various SDKs: