Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub MakeandBreak()
Charts.Add Set thisChart = ActiveChart thisChart.Delete End Sub worked fine for me. Prompted if I wanted to delete the chart Sub MakeandBreak() Charts.Add Set thisChart = ActiveChart Application.DisplayAlerts = False thisChart.Delete Application.DisplayAlerts = True End Sub that said, this works because ThisChart is visible to the procedure where I delete it. I suspect that is not your case. You need to declare thischart as a public variable - do it at the top of a general module outside any procedure Public thisChart as Chart Sub CreateChart Charts.Add Set thisChart = ActiveChart End Sub Sub deleteChart Application.DisplayAlerts = False thisChart.Delete Application.DisplayAlerts = True End Sub that should work. -- Regards, Tom Ogilvy MikeM wrote in message ... Suppose I create a chart with Charts.Add set thisChart = ActiveChart Why can't I delete it with thisChart.Delete? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to delete chart | Charts and Charting in Excel | |||
Delete Chart Event | Charts and Charting in Excel | |||
Delete embedded chart, how? | Charts and Charting in Excel | |||
delete chart | Excel Discussion (Misc queries) | |||
Delete Chart | Charts and Charting in Excel |