ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Automatically Confirm Deleting Charts (https://www.excelbanter.com/excel-programming/304689-automatically-confirm-deleting-charts.html)

fatfish[_2_]

Automatically Confirm Deleting Charts
 
Hi All,

I'd like to clean all the created charts after analysis,
so I record a macro to delete the charts one by one.

The problem is: there will always popup a msg box asking
me to confirm deleting the charts.

Is there a way to disable the confirming deleting msg?

Thanks in advance

--
Message posted from http://www.ExcelForum.com


Frank Kabel

Automatically Confirm Deleting Charts
 
Hi
try

application.displayalerts=false
'your deletion code
application.displayalerts=true

-----Original Message-----
Hi All,

I'd like to clean all the created charts after analysis,
so I record a macro to delete the charts one by one.

The problem is: there will always popup a msg box asking
me to confirm deleting the charts.

Is there a way to disable the confirming deleting msg?

Thanks in advance!


---
Message posted from http://www.ExcelForum.com/

.


Amedee Van Gasse[_3_]

Automatically Confirm Deleting Charts
 
fatfish wrote:

Hi All,

I'd like to clean all the created charts after analysis,
so I record a macro to delete the charts one by one.

The problem is: there will always popup a msg box asking
me to confirm deleting the charts.

Is there a way to disable the confirming deleting msg?

Thanks in advance!



Put this at the start of *every* macro you record:

With Application
.Calculation = xlManual
.ScreenUpdating = False
.DisplayAlerts = False
End With

And this at the end:

With Application
.Calculation = xlAutomatic
.ScreenUpdating = True
.DisplayAlerts = True
End With

It's the DisplayAlerts stuff that will solve your problem.


PS: Please don't thank people in advance. It's more polite (and more
motivating) to thank them afterwards.

--
Amedee Van Gasse

To top-post is human, to bottom-post and snip is sublime.

fatfish[_3_]

Automatically Confirm Deleting Charts
 
Hi Frank & Amedee,

Thanks!
Both of them works very well!!

Amedee's code also disable the screenupdating, which makes
the macro "cleaner"! ;)
and thanks for your suggestion of "No thanks in advance" ! :P

Best Regards,
Fatfis

--
Message posted from http://www.ExcelForum.com


Amedee Van Gasse[_3_]

Automatically Confirm Deleting Charts
 
fatfish wrote:

Hi Frank & Amedee,

Thanks!
Both of them works very well!!

Amedee's code also disable the screenupdating, which makes
the macro "cleaner"! ;)
and thanks for your suggestion of "No thanks in advance" ! :P

Best Regards,
Fatfish


---
Message posted from http://www.ExcelForum.com/


Thank you for thanking me. Now nothing can spoil my day! :)

--
Amedee Van Gasse

To top-post is human, to bottom-post and snip is sublime.


All times are GMT +1. The time now is 10:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com