Microsoft Office Tutorials and References
In Depth Information
Web Service API Methods
Calling GetRangeA1
The following example makes three GetRangeA1 calls. Comments are provided prior to each
GetRangeA1 call to describe what is going to be retrieved.
try
{
string xlSessionId;
Status[] xlStatus;
object[] rangeResult;
xlSessionId = xlEcsApi.OpenWorkbook(
@”http://theexcelserver/testsite/Shared Documents/workbook.xlsb”,
@”en-US”,
@”de-DE”,
out xlStatus);
//get the unformatted value for cell B1 on Sheet1
rangeResult = xlEcsApi.GetRangeA1(
xlSessionId,
“Sheet1”,
“B1:B1”,
false,
out xlStatus);
//get the formatted value for the range associated with Table1 on Sheet1
rangeResult = xlEcsApi.GetRangeA1(
xlSessionId,
“Sheet1”,
“Table1”,
true,
out xlStatus);
//get the unformatted value for the range H5:L15 on Sheet1
rangeResult = xlEcsApi.GetRangeA1(
xlSessionId,
“Sheet1”,
“H5:L15”,
false,
out xlStatus);
}
GetRange
The GetRange method of the Excel Services web service returns the calculated values for a single cell
or a range that is specified using range coordinates. The declaration for the GetRange method looks
like this:
public object[] GetRange(string sessionId, string sheetName, RangeCoordinates
rangeCoordinates, bool formatted, out Status[] status)
Search JabSto ::




Custom Search