This tutorial guides you in adding a column in Excel using Python REST API. You will learn how to add a whole column in Excel using Python-based API with Python-based Cloud SDK. It assists in selecting the target sheet, start column, and total columns that you want to insert.
Prerequisite
- Create an account and get API credentials for adding a column
- Download Aspose.Cells Cloud SDK for Python to insert columns in an existing worksheet
- Setup Python project with the above SDK
Steps for Making Columns in Excel using Python Low Code API
- Provide your Aspose Cloud App Key and App Secret to authenticate your access to the Aspose.Cells API
- Use these credentials to initialize the CellsApi client that will manage all interactions with the cloud service
- Select the Excel file on your local machine that you want to modify
- Upload the selected Excel file to Aspose Cloud so it can be processed remotely
- Set up the details for inserting new columns, including worksheet name, column index, number of columns, and reference updates
- Send the configured column insertion request PutInsertWorksheetColumns to the Aspose.Cells API to apply changes to the worksheet
- After processing, download the modified Excel file from the cloud storage
- Save the downloaded file locally with a new name to preserve the original version
These steps summarize how to add a new column in Excel using Python-based API. To modify an Excel file using Aspose.Cells Cloud, authenticate with your API credentials, upload the file, configure the column insertion, and send the request to update the worksheet. After processing, download the modified file and save it locally while handling any potential errors.
Code for Adding Multiple Columns in Excel using Python RESTful Service
The above code demonstrates how to create a column in Excel using Python Low Code API. You can add multiple columns by setting the desired number in the respective parameter “columns” in the PutInsertWorksheetColumnsRequest(). The “updateReference” property is set to “true” for updating references in the workbook dependent on these columns.
This article has taught us the process of adding columns. To delete a chart, refer to the article Delete chart in Excel using Python REST API.