Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Ignoring a Message Box

  Asked By: Steven    Date: Jan 28    Category: MS Office    Views: 595
  

I'm trying to code into my program the ability to automatically
click "ok" on a message box that excel automatically pops up (I'm
deleting a worksheet - and excel asks if this is ok).

Any ideas on how I can ignore the trivial message box?

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Edfu Massri     Answered On: Jan 28

You need to switch off alerts before deleting the worksheet

Application.DisplayAlerts = False

Once the worksheet  has been deleted switch alerts back on with

Application.DisplayAlerts = True.

 
Answer #2    Answered By: Samuel Costa     Answered On: Jan 28

You want to use the DisplayAlerts option. For example:

Application.DisplayAlerts=False
'Your delete code  goes here
Application.DisplayAlerts=True

For more related info, see:

http://www.ozgrid.com/VBA/ExcelVBAErrors.htm

 
Didn't find what you were looking for? Find more on Ignoring a Message Box Or get search suggestion and latest updates.




Tagged: