Application.EnableEvents = False not working

M

modo8

Hello-

I have some macro language that deletes a sheet which will always have data
on it. I don't want to have to confirm the popup message "Data may
exist...", so I put in the Application.EnableEvents = False language. Thing
is, the prompt still comes up! Any ideas? I'm using Excel 2002 if that
makes a difference. Language below. Thanks a bunch!

Windows(FileName).Activate
Sheets(DeleteSheet).Select
Application.EnableEvents = False
ActiveWindow.SelectedSheets.Delete
Application.EnableEvents = True
 
J

JLGWhiz

I think you want

Application.DisplayAlerts = False

'The code

Application.DisplayAlerts = True
 

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

Top