ExcelService.SetRange Method

Sets values or formulae into a range, using numeric range coordinates.

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

public void SetRange(
	string sessionId,
	string sheetName,
	RangeCoordinates rangeCoordinates,
	Object[] rangeValues,
	out Status[] status


Type: System.String

The Excel Web Services session ID.

Type: System.String

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

Type: Microsoft.Office.Excel.Server.WebServices.RangeCoordinates

The four integer coordinates used to select a contiguous range.

Type: []

Array of values for the range being set.

Type: []

Alert information.

Sets several values (numbers or text) or formulae into a range in the open workbook. Values (numbers or text) and formulae may be passed together into a range. Use numeric range coordinates to select the range.

Setting a formula into a cell requires open item or edit item permissions and is supported in view and edit mode You will get a formula editing not enabled alert if you attempt to set a formula into a cell in view mode with only view item permission.

Setting a value or a formula into a cell replaces the previous value or formula, but does not affect the formatting of the cell. To set a cell to be empty, use Null. If a null object value is passed, the respective cell value will be cleared.

If the dimensionality of the array of values does not exactly match that of the range, the call will be aborted and will return an error.