代码如下:
 失败的创建 -> ActiveChart.Location Where:=xlLocationAsNewSheet, Name:="图表名称"
 成功的创建 -> ActiveChart.Location xlLocationAsNewSheet

解决方案 »

  1.   

    xarrow(HELLO WORLD)睡了回龙觉?幸福啊
      

  2.   

    Sub MoveChart()
          Dim x As Chart
          ' Create an embedded chart on a chart sheet.
          Set x = Charts.Add
          x.ChartType = xlColumnClustered
          x.SetSourceData Source:=Sheets("Sheet1").Range("A1:C4")
          Set x = x.Location(where:=xlLocationAsObject, Name:="Sheet1")
          ' Move chart to new sheet and reset the chart object variable x.
          Set x = x.Location(where:=xlLocationAsNewSheet, Name:="Chart1")      ' Move chart to back to the chart sheet.
          Set x= x.Location(where:=xlLocationAsObject, Name:="Sheet1")
       End Sub