LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Delete chart without being prompted?

Did the trick!! Thanks!!


"Mark Ivey" (do_not_spam) wrote in message
...
See if this will work...

Mark Ivey


Sub AddDeleteChartTest()
Dim c As Excel.Chart

Set c = Excel.Charts.Add

Application.DisplayAlerts = False

c.Delete

Application.DisplayAlerts = True

End Sub










"Herrick Andrews" <Herrick.Andrews@AT wrote in message
...
Is there a way to delete a chart object via VBA code without it prompting
me if I really want to delete it? If I change the location of the chart
so it's embedded in a worksheet, and then delete it, I don't get
prompted. But I can't do that. I need to delete the chart while it's its
own chart sheet (not embedded in a worksheet). I created the chart
programmatically.

The following two lines of code cause the problem every time for me.

Sub AddDeleteChartTest()
Dim c As Excel.Chart

Set c = Excel.Charts.Add

c.Delete ' I get a DialogBox saying "Data may exist in the sheet(s)
selected for deletion. To permanently delete the data, press Delete."
End Sub



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the VBA to put the password in the prompted box Frank Situmorang[_3_] Excel Discussion (Misc queries) 5 May 4th 09 12:39 PM
Prompted to save hetherjw Excel Discussion (Misc queries) 5 October 27th 05 06:22 PM
Why Prompted To Save Again? Izar Arcturus Excel Programming 3 December 17th 03 05:02 PM
Save as CSV without being prompted Tom Ogilvy Excel Programming 0 July 18th 03 12:05 AM
Save as CSV without being prompted Randall Arnold[_2_] Excel Programming 0 July 17th 03 10:36 PM


All times are GMT +1. The time now is 07:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"