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.
chartLocationChart.ChartLocation.ChartAsSheet or Chart.ChartLocation.ObjectInSheet.
sheetNameNew name for the sheet to which the chart is moved.
ArgumentExceptionAn ArgumentException will be thrown in two cases. First, if
ChartAsSheetand a sheet (
sheetNamealready exists. Second, if
ObjectInSheet, and a sheet named
sheetNamealready exists and is a
ChartAsSheet, this will create a
sheetName at the end of the workbook and move the chart into it.
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.