Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

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#
 public void MoveChart(ChartLocation chartLocation, int sheetIndex)
{signature}{signature:
}
Signature
vb.net
vb.net
Public Sub MoveChart(ByVal chartLocation As ChartLocation, ByVal sheetIndex As Integer)
{signature}
{parameters}
{param:chartLocation}[
Parameters
Param
chartLocation
chartLocation

Chart.ChartLocation.ChartAsSheet

|Chart.ChartLocation#ChartAsSheet]

or

[

Chart.ChartLocation.ObjectInSheet

|Chart.ChartLocation#ObjectInSheet].{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 total number of worksheets. {exception} {exception:ArgumentException} An ArgumentException will be thrown if {{chartLocation}} is {{ObjectInSheet}} but the sheet at index {{sheetIndex}} is actually a {{Chartsheet}}. {exception} {remarks} If {{chartLocation}} is {{ChartAsSheet}}, this method will create a new {{Chartsheet}} at {{sheetIndex}} that contains the chart. If {{chartLocation}} is {{ObjectInSheet}}, this method will move the chart into the worksheet at {{sheetIndex}}, maintaining the original chart position. 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}

.

Param
sheetIndex
sheetIndex

The 0-based index of the worksheet to move the chart to or the index of the chartsheet to insert.

Exceptions
Exception
IndexOutOfRangeException
IndexOutOfRangeException

An IndexOutOfRangeException will be thrown if sheetIndex is less than 0 or greater than the total number of worksheets.

Exception
ArgumentException
ArgumentException

An ArgumentException will be thrown if chartLocation is ObjectInSheet but the sheet at index sheetIndex is actually a Chartsheet.

Remarks

If chartLocation is ChartAsSheet, this method will create a new Chartsheet at sheetIndex that contains the chart.

If chartLocation is ObjectInSheet, this method will move the chart into the worksheet at sheetIndex, maintaining the original chart position.

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.

Scrollbar