You need to delete the chart object. So try something like
ActiveChart.Parent.Delete
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. -
http://PeltierTech.com
_______
"Shell" <(E-Mail Removed)> wrote in message
news:17F34AFF-6D83-4BE4-BE15-(E-Mail Removed)...
> Yes I have. it crashes. I need to rerun it to get the err msg.
> Note: the chart is embedded on the same sheet as the data.
> --
> Shell
>
>
> "Don Guillett" wrote:
>
>> Have you tried recording a macro?
>>
>> --
>> Don Guillett
>> Microsoft MVP Excel
>> SalesAid Software
>> (E-Mail Removed)
>> "Shell" <(E-Mail Removed)> wrote in message
>> news:BCC71AF2-BBCF-4D3B-85AA-(E-Mail Removed)...
>> >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 Where:=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
>>
>>