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)
| ||
Signature | ||
{signature}{signature:vb.net | vb.net | }
Public Sub MoveChart(ByVal chartLocation As ChartLocation, ByVal sheetName As String)
|
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. |
Exceptions |
---|
...
An ArgumentException will be thrown in two cases. First, if chartLocation
is ChartAsSheet
and a sheet (Worksheet
or Chartsheet
) named sheetName
already exists. Second, if chartLocation
is ObjectInSheet
, and a sheet named sheetName
already exists and is a Chartsheet
.
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}
{exceptions}
{exception:ArgumentException}
An ArgumentException will be thrown in two cases. First, if {{chartLocation}} is {{ChartAsSheet}} and a sheet ({{Worksheet}} or {{Chartsheet}}) named {{sheetName}} already exists. Second, if {{chartLocation}} is {{ObjectInSheet}}, and a sheet named {{sheetName}} already exists and is a {{Chartsheet}}.
{exception}
{remarks}
If {{chartLocation}} is {{ChartAsSheet}}, this will create a {{Chartsheet}} named {{sheetName}} at the end of the workbook and move the chart into it.
If {{chartLocation}} is {{ObjectInSheet}} and there is already a worksheet named {{sheetName}}, this will move the chart into that sheet. If there is no such sheet, this will create a new {{Worksheet}} with that name at the end of the workbook and move the chart into it.
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} |