Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
msgbox
I want to delete a worksheet, every time I open a workbook, but how can I
stop the msgbox from popping up with the message " Data may exist...... ? Regards Kjeldc |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
msgbox
Just what I needed. Thanks Jim.
"Jim Thomlinson" skrev: You need to toggle the display alerts setting... Application.DisplayAlerts = False Application.DisplayAlerts = True As with any application level setting you are best off to use an error handler something like this (in case your code crashes you need to reset the application) sub Stuff() On error goto ErrorHandler Application.DisplayAlerts = False Sheet1.Delete ErrorHandler: Application.DisplayAlerts = True end sub -- HTH... Jim Thomlinson "Kjeldc" wrote: I want to delete a worksheet, every time I open a workbook, but how can I stop the msgbox from popping up with the message " Data may exist...... ? Regards Kjeldc |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
msgbox
You need to toggle the display alerts setting...
Application.DisplayAlerts = False Application.DisplayAlerts = True As with any application level setting you are best off to use an error handler something like this (in case your code crashes you need to reset the application) sub Stuff() On error goto ErrorHandler Application.DisplayAlerts = False Sheet1.Delete ErrorHandler: Application.DisplayAlerts = True end sub -- HTH... Jim Thomlinson "Kjeldc" wrote: I want to delete a worksheet, every time I open a workbook, but how can I stop the msgbox from popping up with the message " Data may exist...... ? Regards Kjeldc |