ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How-To suppress a warning dialog (https://www.excelbanter.com/excel-programming/306708-how-suppress-warning-dialog.html)

james

How-To suppress a warning dialog
 
Dear Experts

I am trying to delete all but one worksheetsheet
named "products" in active workbook. When ever I try
running the macro a Warning pops up asking All content of
the sheet would be lost, do you wish to continue (or
something like this)
Is there a way to prevent that from poping up.
Please advise

I use xl2002 vba on Win 2k

Thanks
James

Frank Kabel

How-To suppress a warning dialog
 
Hi
try
application.displayalerts=false
'your code
application.displayalerts=true

--
Regards
Frank Kabel
Frankfurt, Germany


James wrote:
Dear Experts

I am trying to delete all but one worksheetsheet
named "products" in active workbook. When ever I try
running the macro a Warning pops up asking All content of
the sheet would be lost, do you wish to continue (or
something like this)
Is there a way to prevent that from poping up.
Please advise

I use xl2002 vba on Win 2k

Thanks
James


kkknie[_181_]

How-To suppress a warning dialog
 
Insert

Application.DisplayAlerts = False

before the deletes and then

Application.DisplayAlerts = True

after.



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



All times are GMT +1. The time now is 01:05 PM.

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