Import String Array into Excel Worksheet – Aspose.Cells Cloud

This REST API imports string‑array data into an Excel worksheet.

REST API

POST https://api.aspose.cloud/v3.0/cells/import
POST https://api.aspose.cloud/v3.0/cells/{name}/importdata

The request uses multipart HTTP content (see RFC 2046 or RFC 1341).
The first part of the multipart body contains an ImportStringArrayOption payload; the second part contains the source data file.

The important parameters are described in the following table:

ImportStringArrayOption

Parameter Name Type Description
FirstRow int The starting row index (1‑based) where the data will be placed.
FirstColumn int The starting column index (1‑based) where the data will be placed.
IsVertical boolean true to insert data vertically; false to insert horizontally.
Data String[] The string array to be imported.
DestinationWorksheet string The name of the worksheet that will receive the data.
IsInsert boolean true to insert rows/columns (shifting existing cells); false to overwrite existing cells.
ImportDataType string Type of data being imported (e.g., IntArray, DoubleArray, StringArray, TwoDimensionIntArray, TwoDimensionDoubleArray, TwoDimensionStringArray, BatchData, csvData).
Source FileSource Describes where the data file resides when BatchData is null (e.g., CloudFileSystem, LocalFile). Required if BatchData is not supplied.

Example

<ImportStringArrayOption>
    <DestinationWorksheet>Sheet1</DestinationWorksheet>
    <IsInsert>false</IsInsert>
    <ImportDataType>StringArray</ImportDataType>
    <FirstRow>1</FirstRow>
    <FirstColumn>1</FirstColumn>
    <IsVertical>true</IsVertical>
    <Source>
        <FileSourceType>CloudFileSystem</FileSourceType>
        <FilePath>Array_string_xml.txt</FilePath>
    </Source>
</ImportStringArrayOption>

Common Errors & Troubleshooting

HTTP Status Cause Remedy
401 Missing or invalid access token Ensure the Authorization: Bearer <token> header is present and the token is still valid.
400 Required parameter omitted (Source or FirstRow) Verify that all mandatory fields are supplied and correctly typed.
415 Incorrect content‑type for multipart body Use multipart/form-data with proper boundary delimiters.
500 Server‑side processing error Check the payload for malformed XML/JSON and confirm that the file referenced in Source exists.

Cloud SDK Family

Using an SDK is the best way to speed up development. An SDK handles low‑level details, allowing you to focus on your project tasks. 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: