Macro to bypass pop-up box

K

Kell2604

Hi Guys -

I have a macro, one of the steps deletes a sheet in my workbook. This macro
will be on a server and running at a specific time each day. My problem is
the action of deleting the sheet causes excel to promt me "Am I sure I want
to delete, yada yada?". Is there a way to tell this macro to automatically
answer yes to the prompt...as a real person will not be around to answer the
question??

Thanks very much!!
Kelley
 
M

Mike H

Hi,

application.displayalerts=false

delete your worksheet

application.displayalerts=true

Mike
 
K

Kell2604

Thanks Mike that worked!!

What if I'm opening a workboot that is locked for editing or password
protected and I want to say YES to the prompt that asks if I want to open the
workbook in read only?
 

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