Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • 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
Joined
Dec 10, 2001
Messages
12
Location
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
 
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

Back
Top