TabNamedRegionOpResult ChangeTabNamedRegion(NamedRegionsId nrMon, ChangeTabRegionArg Arg)
nrMon. Moniker for working with named ranges.
Arg. Operation execution parameters.
The ChangeTabNamedRegion operation changes a table named range.
To execute the operation, in the nrMon field specify regular report instance moniker with the !Sheets!Sheet key!NamedRegions postfix, and in the Arg field specify named range change parameters. The moniker can be obtained on executing the OpenPrxMeta operation.
The operation results in the information about successful named range change.
Below is the example of changing a named range. The request contains moniker for working with named ranges, name of changed range and new settings. The response contains whether change is successful and new name of the named range.
{
"ChangeTabNamedRegion" :
{
"nrMon" :
{
"id" : "ILBNJNHKDBCAGOAEGGMCAJHIOKJPOKMEOIOADBDOFONILPAG!M!S!PAJBBFBIKDBCAGOAEJOAGHLNCNALCNCJEOLBLLFIDBFHIGLPO!Sheets!1!NamedRegions"
},
"Arg" :
{
"ids" :
{
"name" : "Data"
},
"reg" :
{
"left" : "1",
"top" : "11",
"width" : "10",
"height" : "12",
"name" : "Totals"
}
}
}
}
{
"ChangeTabNamedRegionResult" :
{
"res" : "1",
"name" : "Totals"
}
}
public static TabNamedRegionOpResult ChangeTabNamedRegion(string moniker, string changedRegionName, string newName, int leftCell, int topCell, uint bottomCell, uint rightCell)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tChange = new ChangeTabNamedRegion()
{
nrMon = new NamedRegionsId() { id = moniker + "!Sheets!1!NamedRegions" },
Arg = new ChangeTabRegionArg()
{
ids = new TabRegionIdentArg()
{
name = changedRegionName
},
reg = new TabNamedRegion()
{
left = leftCell,
top = topCell,
height = bottomCell,
width = rightCell,
name = newName
}
}
};
// Change named range
var result = somClient.ChangeTabNamedRegion(tChange);
return result;
}
See also: