Condividi tramite


ExcelService.GetCell Method

Gets a calculated value from a cell in the open workbook, using numeric cell coordinates.

Namespace:  Microsoft.Office.Excel.Server.WebServices
Assembly:  Microsoft.Office.Excel.Server.WebServices (in Microsoft.Office.Excel.Server.WebServices.dll)

Syntax

'Declaration
<WebMethodAttribute> _
Public Function GetCell ( _
    sessionId As String, _
    sheetName As String, _
    row As Integer, _
    column As Integer, _
    formatted As Boolean, _
    <OutAttribute> ByRef status As Status() _
) As Object
'Usage
Dim instance As ExcelService
Dim sessionId As String
Dim sheetName As String
Dim row As Integer
Dim column As Integer
Dim formatted As Boolean
Dim status As Status()
Dim returnValue As Object

returnValue = instance.GetCell(sessionId, _
    sheetName, row, column, formatted, _
    status)
[WebMethodAttribute]
public Object GetCell(
    string sessionId,
    string sheetName,
    int row,
    int column,
    bool formatted,
    out Status[] status
)

Parameters

  • sessionId
    Type: System.String

    The Excel Web Services session ID.

  • sheetName
    Type: System.String

    The name of the sheet that you want to reference. Sheet name length is limited to 31 characters.

  • formatted
    Type: System.Boolean

    true returns formatted strings.

    false returns raw values.

  • status
    Type: []

    Alert information.

Return Value

Type: System.Object
Value of the requested cell.

Remarks

Returns the value from a single cell, using numeric cell coordinates to select the cell.

A cell can be a range reference, a named range, or a named data object.

The API checks only the result dimensions, not the dimensions of the requested range. For example, the caller might ask for a 2x3 range, and Excel Calculation Services might return a 1x1 range (for example, because of hidden cells).

To get values from multiple adjacent cells, consider using the GetRange method instead of making multiple calls to the GetCell method. This results in a single round trip to the server instead of multiple round trips. Therefore, in some cases, you may gain a performance improvement by using the GetRange method instead of the GetCell method.

See Also

Reference

ExcelService Class

ExcelService Members

Microsoft.Office.Excel.Server.WebServices Namespace