Microsoft Office Tutorials and References
In Depth Information
Web Service API Methods
rangeValues[0] = firstRow;
rangeValues[1] = secondRow;
//set values for the cells in the K5:M6 range on Sheet1
xlStatus = xlEcsApi.SetRangeA1(
xlSessionId,
“Sheet1”,
“K5:M6”,
rangeValues);
//set values for the cells in Table2
xlStatus = xlEcsApi.SetRangeA1(
xlSessionId,
string.Empty,
“Table2”,
rangeValues);
}
SetRange
The SetRange method of the Excel Services web service sets values into a range that you specify using
range coordinates. The declaration for the SetRange method looks like this:
public Status[] SetRange(string sessionId, string sheetName, RangeCoordinates
rangeCoordinates, object[] rangeValues)
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 SetRange call. Making a SetRange
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
rangeCoordinates .
rangeCoordinates (in) — Use the RangeCoordinates type to specify the range that
is to be set. The range can be a single cell or a contiguous range. The RangeCoordinates
type has four properties:
Column — The zero-based integer index, where column A is 0.
Row — The zero-based integer row index, where row 1 is 0.
Height — An integer greater than 0, which represents the row height of the range.
Width — An integer greater than 0, which represents the column width of the range.
rangeValues (in) — This is an array of array of objects that is the array of values to be set in
the specified rangeCoordinates . Empty cells are represented in the array as null .
A SOAP exception occurs when the dimensions of the rangeValues object do not match the dimensions
of the rangeCoordinates .
Search JabSto ::




Custom Search