Thread: Delete a chart
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Nigel[_2_] Nigel[_2_] is offline
external usenet poster
 
Posts: 735
Default Delete a chart


Charts.Add
myChart = ActiveChart.Name



Sheets(myChart).Delete


--

Regards,
Nigel




"Shell" wrote in message
...
I have created a chart in code as follows:

Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceData Source:=Sheets("Analysis").Range("B1:C3"),
PlotBy:= _
xlColumns
ActiveChart.Location Whe=xlLocationAsObject, Name:="Analysis"
With ActiveChart
.HasTitle = False
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
End With

How do I delete the chart in code?

Thanks

--
Shell