Microsoft Office Tutorials and References
In Depth Information
Web Service API Methods
GetRangeA1
The GetRangeA1 method of the Excel Services web service returns the calculated values for a single cell,
a named range, a named object, or a range that is specified with A1 notation. The declaration for the
GetRangeA1 method looks like this:
public object[] GetRangeA1(string sessionId, string sheetName, string rangeName,
bool formatted, out Status[] status)
Parameters
Following are the parameters for this method:
sessionId (in) — The sessionId string that was returned from a prior OpenWorkbook call.
The session must still be active at the time of the GetRangeA1 call. Making a GetRangeA1 call
using a sessionId that has timed out results in a SOAP exception.
sheetName (in) — Use this string to specify the name of the sheet containing the rangeName.
You can pass the sheetName as String.Empty or “” when you use a defined name or the name
of an object for the rangeName.
rangeName (in) — Use this string to specify the single cell or range to be retrieved. You can
specify the rangeName using a defined name or an object name that represents the range to be
retrieved. You can also use A1 notation.
formatted (in) — Use this Boolean to specify whether formatted strings (true) or raw
values (false) are to be returned.
Status (out) — See the “Status Class” section, earlier in this chapter, for an explanation of
this ( out ) parameter.
The behavior of GetRangeA1 is dependent on the values that you provide for the sheetName and the
rangeName parameters. Following are common uses for the RangeA1 method:
Retrieve a single cell — Specify a sheetName . Set the rangeName to a defined name that
references a single cell or set the rangeName using A1 notation. For example, set the rangeName to
“B1:B1” to retrieve the contents of cell B1.
Retrieve a range — Specify a sheetName. Set the rangeName to a defined name that references a
range or set the rangeName using A1 notation For example, set the rangeName to “B1:C10” to
retrieve the contents of the cells in the B1:C10 contiguous range.
Retrieve a range associated with an object — Specify a sheetName . Set the rangeName to the name
of an object. For example, set the rangeName to “Table1” to retrieve the range of data contained
within Table1. (The column header row for Table1 is not returned.)
Return Value
An array of values for the requested range is returned. The returned array has the same dimensions as
the requested range. When the formatted parameter is true , string.empty is returned for empty
cells. When the formatted parameter is false , null is returned for empty cells.
GetRangeA1 returns the values from cells in hidden rows and columns. If column A is hidden and the
rangeName is “A1:B1” , then two objects would be returned: one for cell A1 and one for cell B1.
Search JabSto ::




Custom Search