Get MaxColumn from Excel Worksheet

This REST API returns the maximum column index in an Excel worksheet when the cellOrMethodName parameter is set to maxcolumn.

Parameters

Parameter Type Required Default Description
cellOrMethodName string Yes Must be set to maxcolumn to invoke this method.
folder string No "" Folder path in cloud storage where the workbook resides.
storage string No "" Name of the storage service (if multiple are configured).
fileName string Yes Name of the Excel file (e.g., myWorkbook.xlsx).
sheetName string Yes Name of the worksheet (e.g., Sheet1).
  • cURL Example
  • Error Handling
HTTP Status Meaning Sample Error Body
200 Success – returns the MaxColumn value. { "MaxColumn": 15 }
400 Bad request – missing or invalid parameters. { "Code": "BadRequest", "Message": "ParametercellOrMethodNameis required." }
401 Unauthorized – invalid or missing token. { "Code": "Unauthorized", "Message": "Access token is invalid or expired." }
404 Not found – workbook or worksheet does not exist. { "Code": "NotFound", "Message": "WorksheetSheet1not found." }
500 Server error – unexpected condition. { "Code": "InternalError", "Message": "An unexpected error occurred." }
  • Cloud SDK Family

Using an SDK is the fastest way to develop. An SDK handles low‑level details, allowing you to focus on your project logic. Please check out the GitHub repository for a complete list of Aspose.Cells Cloud SDKs.

The following code examples demonstrate how to call Aspose.Cells web services using various SDKs:

Frequently Asked Questions

What does the **Get MaxColumn** endpoint return? It returns a JSON object that contains a single property **MaxColumn**. The value is the zero‑based index of the rightmost column that contains data in the specified worksheet.
How do I authenticate the request? Include an `Authorization: Bearer ` header. The token is obtained via the Aspose Cloud OAuth 2.0 client‑credentials flow.
What is the difference between **maxcolumn** and **maxdatacolumn**? `maxcolumn` returns the last column that contains any cell (including empty cells), whereas `maxdatacolumn` returns the last column that actually contains data.