Automatically Confirm Deleting Charts

  • Thread starter Thread starter fatfish
  • Start date Start date
F

fatfish

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
 
Hi
try

application.displayalerts=false
'your deletion code
application.displayalerts=true
 
fatfish said:
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.
 
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
 
fatfish said:
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

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top