Thread: msgbox
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Kjeldc Kjeldc is offline
external usenet poster
 
Posts: 33
Default 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