Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-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
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

 
Thanks Mike. I knew there was a simple solution for this one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor