Description |
---|
Excerpt |
---|
Moves the chart to a different worksheet. The method specifies whether the chart should be inserted as an object within the worksheet, or converted to a chart sheet. |
Signature | C# | C# |
---|---|---|
Wiki Markup | ||
{description}
{excerpt}Moves the chart to a different worksheet. The method specifies whether the chart should be inserted as an object within the worksheet, or converted to a chart sheet.{excerpt}
{signature:C#}
public void MoveChart(ChartLocation chartLocation, System.String sheetName, int sheetIndex)
| ||
Signature | ||
{signature}{signature:vb.net | vb.net | }
Public Sub MoveChart(ByVal chartLocation As ChartLocation, ByVal sheetName As String, ByVal sheetIndex As Integer)
|
Parameters |
---|
Param | ||
---|---|---|
chartLocation | chartLocation | {signature} {parameters} {param:chartLocation}[Chart.ChartLocation.ChartAsSheet|Chart.ChartLocation#ChartAsSheet] or [Chart.ChartLocation.ObjectInSheet. |
Param | sheetName | sheetName |
New name for the sheet to which the chart is moved. | ||
Param | sheetIndex | sheetIndex |
The 0-based index of the worksheet to move the chart to or the index of the chartsheet to insert. |
Exceptions |
---|
...
An IndexOutOfRangeException will be thrown if sheetIndex
is less than 0 or greater than the number of sheets in the workbook.
...
An ArgumentException will be thrown if chartLocation
is ObjectInSheet
and the sheet at sheetIndex
is a Chartsheet
, if chartLocation
is ChartAsSheet
and there is already as sheet named sheetName
or if chartLocation
is ChartAsSheet
and sheetName
is not a valid worksheet name. See Worksheet.Name
for a description of what is a valid worksheet name.
...
An ArgumentNullException will be thrown if chartLocation
is ChartAsSheet
and sheetName
is null.
Remarks |
---|
If If In either case, the chart's formulas (for series data, axis titles, etc) will maintain their original references. If the chart is inside a chartsheet before calling this method, that chartsheet is deleted. |
...
|Chart.ChartLocation#ObjectInSheet].{param}
{param:sheetName}New name for the sheet to which the chart is moved.{param}
{param:sheetIndex}The 0\-based index of the worksheet to move the chart to or the index of the chartsheet to insert.{param}
{exceptions}
{exception:IndexOutOfRangeException}
An IndexOutOfRangeException will be thrown if {{sheetIndex}} is less than 0 or greater than the number of sheets in the workbook.
{exception}
{exception:ArgumentException}
An ArgumentException will be thrown if {{chartLocation}} is {{ObjectInSheet}} and the sheet at {{sheetIndex}} is a {{Chartsheet}}, if {{chartLocation}} is {{ChartAsSheet}} and there is already as sheet named {{sheetName}} or if {{chartLocation}} is {{ChartAsSheet}} and {{sheetName}} is not a valid worksheet name. See [{{Worksheet.Name}}|Worksheet.Name] for a description of what is a valid worksheet name.
{exception}
{exception:ArgumentNullException}
An ArgumentNullException will be thrown if {{chartLocation}} is {{ChartAsSheet}} and {{sheetName}} is null.
{exception}
{remarks}
If {{chartLocation}} is {{ChartAsSheet}}, this will create a {{Chartsheet}} at {{sheetIndex}} named {{sheetName}} and move the chart to the chartsheet.
If {{chartLocation}} is {{ObjectInSheet}}, this will move the chart to the worksheet at {{sheetIndex}}.
In either case, the chart's formulas (for series data, axis titles, etc) will maintain their original references.
If the chart is inside a chartsheet before calling this method, that chartsheet is deleted.
{remarks}
{scrollbar} |