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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable MsgBox when closing workbooks

Status
Not open for further replies.

Waynest

Programmer
Jun 22, 2000
321
0
0
GB
I've got a few routines which generate excel spreadsheets using OLEDB. Does anyone know how to stop Excel prompting to see if you are sure you want to close stuff? I cant make everything as automated as I would like because the poxy MsgBoxes keep popping up e.g. the following results in an undesired MsgBox

Sheets("Sheet2").Select
ActiveWindow.SelectedSheets.Delete

Alternatively, is there a way to specify a default reply of yes?
 
before ActiveWindow.SelectedSheets.Delete use Application.DisplayAlerts = False

I hope it will do
bye
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top