Thread: msgbox
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_4_] Jim Thomlinson[_4_] is offline
external usenet poster
 
Posts: 1,119
Default 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