Microsoft Office Tutorials and References
In Depth Information
Web Service API Methods
xlRange.Height = 2;
xlRange.Width = 1;
//calculate range A1:A2 on Sheet3
xlStatus = xlEcsApi.Calculate(xlSessionId, “Sheet3”, xlRange);
The CalculateWorkbook method of the Excel Services web service calculates the entire workbook
using one of the two supported types of calculation. The declaration for the CalculateWorkbook
method looks like this:
public Status[] CalculateWorkbook(string sessionId, CalculateType calculateType)
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 CalculateWorkbook call. Making a
CalculateWorkbook call using a sessionId that has timed out results in a SOAP exception.
CalculateType (in) — Use this CalculateType type to specify the type of calculation
to be performed. There are two supported enumerators for CalculateType :
CalculateFull — All formulas are calculated, but the dependency tree is not rebuilt.
Recalculate — Only dirty formulas are calculated.
Return Value
A status object is returned by default with a value of null . See the “Status Class” section, earlier in this
chapter, for an explanation of this return type.
Calling CalculateWorkbook
The following example makes a CalculateWorkbook call using the CalculateFull enumerator:
string xlSessionId;
Status[] xlStatus;
xlSessionId = xlEcsApi.OpenWorkbook(
@”http://theexcelserver/testsite/Shared Documents/workbook.xlsb”,
out xlStatus);
xlStatus = xlEcsApi.CalculateWorkbook(
Search JabSto ::

Custom Search