Friends,
I have written VBA code that loops through 150 workbooks and performs
various tasks on each workbook. One task I need to perform is deleting one
sheet in each workbook.
Problem is, the Excel Delete Sheet Warning message box appears before each
deletion, which means I need to manually confirm the deletion 150 times. Is
there a VBA way to turn off Excel's delete sheet warning (like there is in
Access)?
Thanks for your help ...
bill morgan
Gary Keramidas - 28 Feb 2006 18:18 GMT
something like this
Sub delsheet()
Application.DisplayAlerts = False
Worksheets("sheet3").Delete
Application.DisplayAlerts = True
End Sub

Signature
Gary
> Friends,
>
[quoted text clipped - 10 lines]
>
> bill morgan
bill_morgan - 28 Feb 2006 22:50 GMT
So simple! Thanks, Gary ...
> something like this
>
[quoted text clipped - 19 lines]
> >
> > bill morgan
Jim Thomlinson - 28 Feb 2006 18:18 GMT
application.displayalerts = false
sheets("Whatever").Delete
application.displayalerts = true

Signature
HTH...
Jim Thomlinson
> Friends,
>
[quoted text clipped - 10 lines]
>
> bill morgan
bill_morgan - 28 Feb 2006 22:50 GMT
Excellent. Thank you, Jim ...
> application.displayalerts = false
> sheets("Whatever").Delete
[quoted text clipped - 14 lines]
> >
> > bill morgan
Ron de Bruin - 28 Feb 2006 18:24 GMT
Hi Bill
You can use this
Application.DisplayAlerts = False
'Code
Application.DisplayAlerts = True

Signature
Regards Ron de Bruin
http://www.rondebruin.nl
> Friends,
>
[quoted text clipped - 10 lines]
>
> bill morgan
bill_morgan - 28 Feb 2006 22:51 GMT
Thanks, Ron. Everybody giving me the same answer, so must be the BEST way ...
> Hi Bill
>
[quoted text clipped - 18 lines]
> >
> > bill morgan
davesexcel - 28 Feb 2006 18:26 GMT
Sub ..
Application.DisplayAlerts = False
'your code here ...
Application.DisplayAlerts = True
End Su
bill_morgan - 28 Feb 2006 22:51 GMT
Thanks, Dave. Glad I asked ... so simple, but would have taken me awhile to
figure out.
> Sub ..
> Application.DisplayAlerts = False
> 'your code here ...
> Application.DisplayAlerts = True
> End Sub