ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   getting rid of the "confirm delete" dialogue box when deleting a s (https://www.excelbanter.com/excel-discussion-misc-queries/235725-getting-rid-confirm-delete-dialogue-box-when-deleting-s.html)

Bernard

getting rid of the "confirm delete" dialogue box when deleting a s
 
I have a workbook with thousands of sheets and want to use a macro to delete
selected sheets. Problem is the macro is stopped to "The selected sheet will
be permanently deleted, please confirm delete.............".
Can this dialogue box be turned off permanently?
thanks
Bernard.

Don Guillett

getting rid of the "confirm delete" dialogue box when deleting a s
 

application.displayalerts=false
code
reset to true
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Bernard" wrote in message
...
I have a workbook with thousands of sheets and want to use a macro to
delete
selected sheets. Problem is the macro is stopped to "The selected sheet
will
be permanently deleted, please confirm delete.............".
Can this dialogue box be turned off permanently?
thanks
Bernard.



Shane Devenshire[_2_]

getting rid of the "confirm delete" dialogue box when deleting a s
 
Hi,

I generally recommend you bracket the command that will cause the message to
display as follows

Application.DisplayAlert = False
' the delete sheet line
Application.DisplayAlert = False

the reason is that this suppresses most alert until the subroutine is
complete and if there are any other parts of your code that would generate an
alert if something was wrong you would not see it.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Bernard" wrote:

I have a workbook with thousands of sheets and want to use a macro to delete
selected sheets. Problem is the macro is stopped to "The selected sheet will
be permanently deleted, please confirm delete.............".
Can this dialogue box be turned off permanently?
thanks
Bernard.


Bernard

getting rid of the "confirm delete" dialogue box when deleting
 
Thanks for that. However it responds with "Run time Error '438'
Object doesn't support this property or method"

I am using Excel 2000.
Bernard.


"Shane Devenshire" wrote:

Hi,

I generally recommend you bracket the command that will cause the message to
display as follows

Application.DisplayAlert = False
' the delete sheet line
Application.DisplayAlert = False

the reason is that this suppresses most alert until the subroutine is
complete and if there are any other parts of your code that would generate an
alert if something was wrong you would not see it.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Bernard" wrote:

I have a workbook with thousands of sheets and want to use a macro to delete
selected sheets. Problem is the macro is stopped to "The selected sheet will
be permanently deleted, please confirm delete.............".
Can this dialogue box be turned off permanently?
thanks
Bernard.


Don Guillett

getting rid of the "confirm delete" dialogue box when deleting
 
If desired, send your file to my address below along with this msg and
a clear explanation of what you want and before/after examples.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Bernard" wrote in message
...
Thanks for that. However it responds with "Run time Error '438'
Object doesn't support this property or method"

I am using Excel 2000.
Bernard.


"Shane Devenshire" wrote:

Hi,

I generally recommend you bracket the command that will cause the message
to
display as follows

Application.DisplayAlert = False
' the delete sheet line
Application.DisplayAlert = False

the reason is that this suppresses most alert until the subroutine is
complete and if there are any other parts of your code that would
generate an
alert if something was wrong you would not see it.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Bernard" wrote:

I have a workbook with thousands of sheets and want to use a macro to
delete
selected sheets. Problem is the macro is stopped to "The selected sheet
will
be permanently deleted, please confirm delete.............".
Can this dialogue box be turned off permanently?
thanks
Bernard.



Gord Dibben

getting rid of the "confirm delete" dialogue box when deleting
 
Shane missed the syntax. Note the "s"

Application.DisplayAlerts = False
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True


Gord Dibben MS Excel MVP

On Thu, 2 Jul 2009 23:42:01 -0700, Bernard
wrote:

Thanks for that. However it responds with "Run time Error '438'
Object doesn't support this property or method"

I am using Excel 2000.
Bernard.


"Shane Devenshire" wrote:

Hi,

I generally recommend you bracket the command that will cause the message to
display as follows

Application.DisplayAlert = False
' the delete sheet line
Application.DisplayAlert = False

the reason is that this suppresses most alert until the subroutine is
complete and if there are any other parts of your code that would generate an
alert if something was wrong you would not see it.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Bernard" wrote:

I have a workbook with thousands of sheets and want to use a macro to delete
selected sheets. Problem is the macro is stopped to "The selected sheet will
be permanently deleted, please confirm delete.............".
Can this dialogue box be turned off permanently?
thanks
Bernard.




All times are GMT +1. The time now is 11:13 AM.

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