Suppressing or trapping system msgs in excel 2k

  • Thread starter Thread starter mike
  • Start date Start date
M

mike

I've automated a timesheet process doing data collection via Access 2k,
building
an excel 2k workbook via VBA containing individual timesheets which are then
printed.
I've used a .xlt template with one worksheet which I duplicate and rename
for each employee.

At the end I delete the templete worksheet, which pops up a Excel system msg
'the selected sheet(s) will be permanently deleted' with cmd btns 'ok or
cancel'...

The VB 'on error' keyword isn't being triggered as I have tried 'on error
resume next'
or forcing an error handler and 'displayalerts = false' without success.

Is there a way to redirect/control this system msg as it is rather confusing
to the end user.

Any suggestion would be greatly appreciated!

Thanks in advance. Doug
 
'displayalerts = false' must be changed

Application.DisplayAlerts = False
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True

Gord Dibben Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top