Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suppress "OK to delete?" dialog

Status
Not open for further replies.

Skullmonkey

Computer
Dec 10, 2001
12
0
0
US
How can I suppress the dialog box that warns the user that a worksheet will be permanently deleted? I'm just deleting a temporary worksheet that I used during my code like this:

Code:
Dim Wks as Worksheet
Set Wks = Worksheets.Add( _
   After:=Worksheets(Worksheets.Count), _
   Type:=xlWorksheet)

'[do work with Wks here]

Wks.delete
 
Replies continue below

Recommended for you

SkullMonkey,

Use the following:

Code:
Dim Wks as Worksheet
Set Wks = Worksheets.Add( _
   After:=Worksheets(Worksheets.Count), _
   Type:=xlWorksheet)

'[do work with Wks here]
Code:
Application.DisplayAlerts = False
Code:
Wks.delete
Code:
Application.DisplayAlerts = True


HTH
Mike

 
Status
Not open for further replies.
Back
Top